How to easily create a Self Signed Certificate with a SAN (Subjective Alternative Name) with PowerShell
Install the Module if its missing
1. Install-Module PKI
Look at the PKI module verify you have it
2. Get-Command -Module PKI
Run the Command, Example below
3. New-SelfSignedCertificate -Subject "CN=domainname.com" -FriendlyName "domainname.com" -DnsName "domainname.com" -NotAfter (Get-Date).AddMonths(36) -CertStoreLocation cert:\LocalMachine\My
Export the File to Disk and Import to IIS
4. mmc (Computer Account - Local Machine - Personal - Certificates)
5. right click on certificate and export as PFX with Password
Add to Trusted Root Certificate Authority on Client Machines
6. mmc (Computer Account -- Local Machine - Trusted Root CA
7. Import the PFX file with the password
8 июл 2024