Install Active Directory Certification Authority (ADCS) on Windows Server / Windows / Windows Server / Install Active Directory Certification Authority (ADCS) on Windows Server

Active Directory Certificate Services (AD CS) allows you to deploy your own PKI infrastructure on a domain network and use it to issue and manage certificates. In this article, we will look at a typical Certification Authority (CA) deployment scenario: installing a root CA and subordinate enterprise AD CS on two Windows Server hosts, and configuring Group Policy to issue certificates in a domain.

In a production environment, you will need to implement a two-tier PKI architecture:

  • Separate root Certification Authority host (Root CA) – this server issues a certificate to sign a subordinate certification server. After the generation of the trusted root certificate, the CRL, and the signing of the subordinate CA’s key, it is recommended to shut down this server (which reduces the risk of compromising the root CA). This server is called RootCA in our example;
  • Issuing CA server (Subordinate CA) – this is the main server that will issue certificates to clients in the organization. It also stores a certificate revocation list and is used to check for certificates that have been revoked. The name of this server is subordCA.

First, you need to configure the RootCA host. This is a computer running Windows Server that does not need to be joined to the AD domain.

Active Directory Certificate Services components are one of the built-in roles on Windows Server 2022/2019/2016. Open the Server Manager and select Add roles and features;

  1. Select the current server, select Active Directory Certification Authority in the list of roles, and click Next; Install root Certification Authority on Windows Server
  2. Select Certification Authority from the list of AD CS role services; Install CA role
  3. Once the installation is complete, you will need to perform the initial setup of the ADCS role. In the Server Manager, click Configure Active Directory Certificate Services on the destination server; Configure Active Directory Certificate Services
  4. Select CA services to configure; Configure role CA on Windows Server
  5. As the root CA server is not added to the AD domain, select here Standalone CA -> Root CA; Deploy Standalone root CA
  6. Select Create a new private key; ADCS: Create a new private keyLeave the default cryptographic options:Cryptographic provider: RSAKey length: 2048Hash algorithm: SHA256CA cryptographic options
  7. Set the Certificate Authority CN;
  8. On the Validity Period page, set the CA certificate to be valid for 15 years; CA certificate validity period
  9. Leave the default paths to the CA database and logs: c:\windows\system32\certlog CA cert logs
  10. If everything is configured correctly, the following message will appear: Configuration succeeded. CA configuration compleated
You can install the ADCS role on Windows Server using PowerShell:

Add-WindowsFeature Adcs-Cert-Authority -IncludeManagementTools

After installing the AD Certificate Services role, run the command:

Install-AdcsCertificationAuthority -CAType EnterpriseRootCA

A special snap-in, the Certification Authority (certsrv.msc), is used to manage certificates in the ADCS. Open it.

Certification Authority console

Then go to the C:\Windows\System32\CertSrv\CertEnroll directory and copy the root certificate and the certificate revocation list from there. You will need these files when configuring an issuing CA (subordinate CA).

Now let’s set up the second subordinate CA host (subordCA). It is not recommended to deploy the AD CS role on an Active Directory domain controller.

  1. Install the AD CS role on it, with the following: Certification Authority
    Certification Authority Web Enrollment
    Certification Authority Web Service
  2. Select CA type – Subordinate CA; Install Subordinate CA
  3. Then select Create a new private key;
  4. Leave the cryptography settings at their default values; set the Common Name for this CA;
  5. On the Certificate request page, select Save a certificate request to file on the target machine and specify the file path for your REQ file;
  6. Click Configure to start the installation.

Now you need to issue a certificate on your Root CA according to the request you generated:

  1. Copy your  *.REQ file to the root of the C:\ drive on rootCA;
  2. Run the command:
    certreq -submit "C:\subordCA.tect.loc_SUBORDCA-1.req"
  3. Select your root CA in the Certification Authority List prompts and click OK; certreq: submit REG
  4. Now open the Certification Authority console at the Root CA and go to the Pending Requests section. Your request should appear in this section. Note the request number, for example, Request ID 2. Right-click on it and select All Tasks -> Issue; Pending certificate requests
  5. Export the signed certificate to a file by using the following command
    certreq -retrieve 2 C:\SubordCA.crt

    Copy the SubordCA.crt file to the intermediate certificate server (subordCA). Install the root certificates and revocation list from the files you copied earlier:

certutil -dspublish -f "C:\PS\RootCA.crt"
certutil -addstore -f root "C:\PS\RootCA.crt"
certutil -addstore -f root "C:\PS\RootCA.crl"

Now install the root certificate you signed:

certutil -installcert C:\PS\SubordCA.crt

Start the CertSrv service. Your intermediate certificate server is ready to issue certificates to clients. The RootCA host can be shutdown.

Now you need to configure a Group Policy in the domain to issue certificates (autoenrollment) to domain clients automatically.

  1. Open the Group Policy Management (gpmc.msc), click on the domain root, select Create a GPO in this domain, and Link it here; Create PKI GPO
  2. Enter a name for the policy and switch to GPO edit mode;
  3. Navigate to Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Public Key Policies;
  4. Choose a template “Certificate Services Client – Auto-Enrollment
  5. Enable the policy and configure it as follows
    Configuration mode: Enabled
    Renew expired certificates, update pending certificates, and remove  revoked certificates.
    Update certificates that use certificate templates.

Certificate Services Client - Auto-Enrollment GPO

Update the policies on the clients and check that your root certificate appears in the Trusted Root Certificates list.

Leave a Reply

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