Installing an SSL Certificate in Windows Server 2008 using powershell
Solution 1:
You can use certutil.exe
. The exact syntax varies based on the the certificate file format (.cer, .pfx...), but one of these options should be able to do the trick:
certutil -addstore my <filename>
certutil -installcert <filename>
certutil -importcert <filename>
certutil -importpfx <filename>
More info here: http://technet.microsoft.com/en-us/library/cc772898(WS.10).aspx.
This also can be done in native PowerShell, but it's a lot more complex, as there is no built-in command for certificate management, so you have to use the .NET X.509 library (System.Security.Cryptography.X509Certificates
).