PowerTip: Use PowerShell to Get SSL Certificate

The Scripting Guys

Dr Scripto

Summary: Learn how to use Windows PowerShell to get an SSL certificate from an internal certification authority.

Hey, Scripting Guy! Question How can I use Windows PowerShell to get an SSL certificate from an internal certification authority (CA)
           and import it to my web server's local certificate store?

Hey, Scripting Guy! Answer Use the Get-Certificate cmdlet, specify the template, the DNS name, subject, and store location, for example
           (this is a one-line command broken to fit on the webpage):

Get-Certificate -Template WebServer -DnsName "webserver.contoso.com"
-CertStoreLocation Cert:\LocalMachine\My  -SubjectName “webserver1.contoso.com”

Note  The certificate cannot be marked exportable using this method.
Thank you to Microsoft PFE, Jason Walker, for today’s PowerTip.

The Scripting Guys
Dr Scripto

Follow Dr Scripto   

No Comments.