Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is it possible to Install an SSL Certificate in Windows Server 2008 R2 using powershell?

If it's not, is it possible with cmd command line?

I am doing it with mmc now but would it be nice to do that with PowerShell.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

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).

share|improve this answer
    
thanks for the info. Today, I was exporting SSLs from win server 2003 and importing them into win server 2008 r2. is this certutil.exe utility from microsoft? any resource you can recommend for me to go over? –  tugberk Jul 9 '11 at 11:39
    
Yes, it's a built-in tool in Windows systems; for detailed syntax, see the link I added to the answer. –  Massimo Jul 9 '11 at 11:45

No time for a sf.com-quality answer, but someone please feel free to improve it, thankyou

Public Key Infrastructure PowerShell module

PowerShell Certificate Provider

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.