Is there any way to add certificate to Local Computer's Trusted Root Certification Authority using command line? I tried using certmgr.exe, it shows success but when i check root CA, i don't see my certificate there.
I followed the guide here:
http://msdn.microsoft.com/en-us/library/ms172241.aspx
Basically trying this command:
certmgr.exe -add -c mycertificate.cer -s -r localMachine root
The command works and shows success on command line, but i can not see the certificate in actual trusted root store through mmc, Is it the procedure for self signed certificate is different?
I have setup an IIS server with SSL Binding to this certificate which is originally placed in "MY" store. But im doing everything through autoamted scripts so i want to know how can i add this certificate to trusted root CA using cmd line option??
Best Answer
Did you try it manually (by double-clicking on the CER file)? If even manually it's not working, you might be encountering a Vista bug.
Install a Root CA certificate from the command line (cmd.exe)
(This requires the Windows SDK. Visual Studio will install it for you and add it to the
%PATH%
.)certmgr /add /c mycertificate.cer /s /r localMachine root
Note that no errors will be reported; the command will always return success (even when using a non-existing file for the certificate!). If the certificate doesn't show up in the Certificate Manager (
certmgr.msc
) after running this command, repeat the process using the manual steps below to check if there is any error in your certificate file.Manual steps to install a Root CA certificate
.cer
file.Install a Root CA certificate from PowerShell
See @harrymc's great answer below.