PoshTip #37 – Generating Self-Signed SSL Certificate Using PowerShell

You can generate a self-signed certificate from Windows PowerShell. To perform this task, you must use the New-SelfSignedCertificate cmdlet.

For example, to generate a self-signed SSL server certificate for WebServer.Domain.Local, you can use the following command:

PS > New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname WebServer.Domain.Local
  • DNSName parameter contains the FQDN
  • CertStoreLocation parameter will add the self signed certificate to the local certificate store

More information: here

 

Thanks for reading! You can follow me on Twitter @PrigentNico

About Nicolas 282 Articles
I work as an IT Production Manager, based in Paris (France) with a primary focus on Microsoft technologies. I have 10 years experience in administering Windows Servers. . I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am "MCSE: Cloud Platform and Infrastructure", "MCSA: Windows Servers", "Administering & Deploying SCCM", and CheckPoint CCSA certified.