Monday, May 13, 2013

Certutil and powershell

Today I learned how to add and remove certificates with "certutil" in powershell. The help is pretty usefull but there where a few things I had to spend time guessing:

There are stores. It's kind of hard to find out what store you are in, but if you use "certuil -viewstore" in powershell the console will show the name of the store it's showing. In my case "CA", you can view another store by using certutil -viewstore "storename".

I also learned that powershell will write "delstore command completed sucessfully" even if provided with names that did not lead to a certificate. So it's important to check if "certutil -delstore" acutally deleted anything in the lines above. You can refer to the certificate by writing its full nickname or title as it appears in the store view that appears using "certutil -viewstore"

certutil -viewstore "storename"
certutil -addstore "storename" "cert. path"
certutil -delstore "storename" "cert. nickname"*

*find the nicenames and store names by calling -viewstore.

No comments:

Post a Comment