Request and remove a certificate using Active Directory templates

Request and remove a certificate using Active Directory templates

You can request from Powershell a certificate from your Active Directory PKI. In that case you will use the cmdlet Get-Certificate. If you already know the template you want to use (for example Enhanced Web Server), you can use this command:

In that example, the certificate is request to the PKI with the following info:

  • Subject :
    • CN=mywebserver.domain.intra
    • C=FR
  • SAN :
    • DNS=mywebserver.domain.intra
    • DNS=myhome.domain.intra

Installation location : Local machine certificate store

To delete the certificate created above, we need first to find the certificate thumbprint :

If the output is corresponding to the certificate we have previously created, note the thumbprint and run the command:

<>

My Powershell script categories

Leave a Reply

Your email address will not be published. Required fields are marked *