Last active
July 12, 2023 13:55
-
-
Save ehrnst/fccc14760a4bf7597979377deef29f82 to your computer and use it in GitHub Desktop.
Request and install a certificate from template using powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Request the certificate throuh template called "WebServer" | |
Get-Certificate -Template "WebServer" -DnsName "computername.fqdn" -CertStoreLocation cert:\LocalMachine\My -SubjectName "CN=computerName.fqdn, C=CountryCode, L=MyCity, O=Organization OU=Department, S=State" | |
# After approval. Use request to download and install cert | |
$cert = (get-childItem -path cert:\LocalMachine\Request) | |
get-certificate -Request cert:\LocalMachine\Request\$cert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment