I'm trying to create a self-signed certificate using power shell. I have tried using import-module PKI but seems like it's supported on powershell v3.0 onward .Is any other way I could create a self-signed certificate using powershell v2.0?
2 Answers
you could download the Windows SDK and use MakeCert
-
Please, read the page header in the referenced link. Makecert.exe is deprecated.– Crypt32Sep 17, 2016 at 19:25
-
since he using Windows 2008 and powershell 2, makecert will work just fine. @CryptoGuy. Sep 17, 2016 at 21:16
-
This one would be better: gallery.technet.microsoft.com/scriptcenter/…. Makecert.exe was deprecated due to extremely weak and outdated cryptography. It was the solution in pre-Vista era, but things changed in Vista/2008 when they got completely new cryptography subsystem.– Crypt32Sep 18, 2016 at 5:35
Have you tried this?
New-SelfSignedCertificate -DnsName 'www.fabrikam.com', 'www.contoso.com' -CertStoreLocation 'cert:\LocalMachine\My'
-
2
New-SelfSignedCertificate
this command works on powershell v3.0 onward. Aug 10, 2016 at 10:54 -
Also on Windows 2008R2, this command did not work even with PowerShell 3.0 (or 4.0, or 5.x)– AntoineLDec 11, 2023 at 15:54