Home/PowerShell/Create custom name self signed certificate using PowerShell

Create custom name self signed certificate using PowerShell

During one of my client requirement, we received request for creating self-signed SSL certificate on IIS server for their play ground environment. so after  analyzing i had found it can be achievable using the New-SelfSignedCertificate cmdlet  which creates a self-signed certificate and its mainly using for testing purposes. Using the CloneCert parameter, a test certificate can be created based on an existing certificate with all settings copied from the original certificate except for the public key. The cmdlet creates a new key of the same algorithm and length.

In Manual, we need follow many steps to create the self signed certificate in IIS, but in powershell we can easily completed within single line of code (shown below).

New-SelfSignedCertificate -FriendlyName USProd_Certif -DnsName PRODCD-USCertificate -CertStoreLocation Cert:\LocalMachine\My

Note:  If you want to add more that one self-signed certificate, then all will be issued with same DNS name (which create in first).

 

 

What do you think?

I hope you have idea of how to Create custom name self signed certificate using PowerShell Script. I would like to have feedback from my posts readers. Your valuable feedback, question, or comments about this article are always welcome.

 

Leave a Reply