October 10th, 2014

PowerTip: Use PowerShell to Get SSL Certificate

Doctor Scripto
Scripter

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.

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.