'how to install certificate by command?

I would like to install a certificate on a live and acceptance windows server. It should be possible with some command. I have did it before but cannot find it. I think it was something with "WinHttpCertCfg.exe".

Does someone know what the command is, or can send me to some website. Thanks alot..



Solution 1:[1]

You can add the Windows Certificate Store using commandline:

certmgr.exe -add "Path\To\Cert\MyCertificate.cer" -s -trustedpublisher

You will need, of cause, administrative rights do this.

You can find further information here.

Hint: If you are adding a self-signed certificate you will need to add the certificate which the new one derives, too. (Example: If you created your own CA intermediate certificate, you will need to add this to the Certificate Store as well)

Solution 2:[2]

I make it works with the following command:

certmgr.exe /c /add my_cert.cer /s root

FYI: https://msdn.microsoft.com/en/library/e78byta0(VS.80).aspx

Solution 3:[3]

I've tested it in Windows 7 and Windows 10. Here is the command:

certutil -f -addstore CA <file_with_extension_and_complete_path>

#certutil -f -addstore CA "D:\test\random.der"

Thanks.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dennis Alexander
Solution 2 Zernel
Solution 3 Maifee Ul Asad