Active Directory Certificate Services: build your own CA
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Core administration and security
-
Phase 3: Enterprise infrastructure
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
Ever since Lesson 25, the intranet and RD Web have been throwing certificate warnings, because they run on self-signed certificates. Active Directory Certificate Services (AD CS) gives you a certificate authority of your own that every domain computer trusts automatically, and it can hand out and renew certificates without anyone having to click through a wizard.
You’ll install an enterprise CA on SRV01, build a web server template and swap out the intranet’s self-signed certificate, then switch on autoenrollment for workstations. After that you’ll break things on purpose with an unpublished template and a revoked certificate.
| Time | You need | By the end you can |
|---|---|---|
| About 90 minutes | DC01, SRV01 and CL01, with the IIS intranet from Lesson 25 | Install an enterprise CA, manage templates, request and bind certificates, configure autoenrollment by GPO, revoke certificates and read revocation errors |
What it is, in one line
Active Directory Certificate Services is the Windows Server role that runs your own public key infrastructure, meaning a certificate authority that issues, renews and revokes certificates for the computers, users and services in your domain.
In Simple Words
The school’s ID card office
Think of the office at a school that makes student ID cards. Every teacher knows that office’s stamp, so a card carrying it is accepted at the library, the canteen and on the bus. The office has a few card designs for different uses (library card, staff card, visitor card), and it keeps a list of lost or cancelled cards that the library checks before it accepts one. In AD CS terms, the CA is the ID office, its root certificate is the stamp, templates are the card designs and the revocation list is that list of cancelled cards.
Engineer's View
CA hierarchy, templates, enrolment, revocation
CA types: an enterprise CA is tied into AD, so it uses certificate templates, publishes its own certificate to AD (which makes domain members trust it automatically) and supports autoenrollment. A standalone CA works without AD and is usually used as an offline root. The recommended design is a two-tier hierarchy, where an offline root CA does nothing but sign the issuing CAs and the online enterprise issuing CAs do the day-to-day work.
Templates decide what a certificate is for (its Enhanced Key Usage, such as Server Authentication), how long it’s valid, the key size, who can Enroll and Autoenroll, and how the subject is built. A CA will only issue templates that have been published on it.
Enrolment: you can request a certificate yourself (Get-Certificate, certlm.msc or certreq), use web enrolment, or let the Group Policy autoenrollment setting do it, and that setting also renews certificates before they expire.
Revocation: to find out whether a certificate has been revoked, clients look at the CRL Distribution Point (CDP) and Authority Information Access (AIA) locations written inside it, and either download the CRL or ask OCSP. If the CRL can’t be downloaded or has expired, a lot of services will refuse the certificate, so keeping the CRL available matters a great deal.
How it works, step by step
Here’s how SRV01 ends up with a trusted certificate for the intranet:
CL01 trusts the result because the SaatLab Root CA certificate was published into AD and pushed into the Trusted Root store of every domain member. Nobody had to import anything by hand, which is what you had to do with the self-signed certificate in Lesson 25.
The PKI you’ll build:
- Install an enterprise root CA, SaatLab Root CA, on SRV01.
- Create a SaatLab Web Server template and publish it.
- Request a certificate for intranet.saatlab.internal and bind it in IIS.
- Autoenroll workstation certificates with a GPO.
- Check revocation information with certutil.
One CA on a busy member server is fine while you’re learning. In production you’d use an offline root with a separate issuing CA, and you’d never put a CA on a DC.
Hands-on Lab: Active Directory Certificate Services on SRV01
Before you run any command, double-check it
Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.
Start DC01, SRV01 and CL01, and take a snapshot of SRV01 called “Before PKI” before you begin. Work on SRV01 as SAATLAB\adm.rahul. Installing an enterprise CA needs an Enterprise Admin, so if adm.rahul isn’t one in your lab, use SAATLAB\Administrator instead.
1Install the enterprise root CA
On SRV01, in PowerShell as administrator:
Install-WindowsFeature ADCS-Cert-Authority -IncludeManagementTools | Out-Null
Install-AdcsCertificationAuthority -CAType EnterpriseRootCA -CACommonName 'SaatLab Root CA' -KeyLength 4096 -HashAlgorithmName SHA256 -ValidityPeriod Years -ValidityPeriodUnits 10 -Force
certutil -pingYou should see something like this:
ErrorId ErrorString
------- -----------
0
Connecting to SRV01.saatlab.internal\SaatLab Root CA ...
Server "SaatLab Root CA" ICertRequest2 interface is alive (16ms)
CertUtil: -ping command completed successfully.On CL01, as administrator, refresh policy and check that the new root has arrived:
gpupdate /force | Out-Null
Get-ChildItem Cert:\LocalMachine\Root | Where-Object Subject -like '*SaatLab*' | Select-Object Subject, NotAfterYou should see something like this:
Subject NotAfter
------- --------
CN=SaatLab Root CA, DC=saatlab, DC=internal 19/10/2036 23:58:12✅ Checkpoint: certutil -ping succeeds on SRV01 and CL01 trusts SaatLab Root CA without any manual import.
2Create and publish a web server template
On SRV01, open certtmpl.msc, right-click Web Server and pick Duplicate Template. On the General tab, set the display name to SaatLab Web Server (the template name turns into SaatLabWebServer) and the validity to 1 year.
On Request Handling, tick Allow private key to be exported, which helps if you run a web farm. On Security, add SRV01$ (object type Computers) with Read and Enroll, and click OK.
Next, publish it on the CA:
Add-CATemplate -Name SaatLabWebServer -Force
Get-CATemplate | Select-Object Name, Oid | Format-Table -AutoSizeYou should see something like this (shortened):
Name Oid
---- ---
SaatLabWebServer 1.3.6.1.4.1.311.21.8.4782311.10930412.1239881.2273614.8811102.42.1188392.9113401
DirectoryEmailReplication ...
DomainController ...
WebServer ...✅ Checkpoint: SaatLabWebServer is in the CA’s list of published templates.
3Replace the intranet certificate
On SRV01, request a certificate and put it into the IIS binding in place of the old one:
$req = Get-Certificate -Template SaatLabWebServer -SubjectName 'CN=intranet.saatlab.internal' -DnsName intranet.saatlab.internal -CertStoreLocation Cert:\LocalMachine\My
$req | Select-Object Status
$new = $req.Certificate
$b = Get-WebBinding -Name Intranet -Protocol https
$b.RemoveSslCertificate()
$b.AddSslCertificate($new.Thumbprint, 'My')
$new | Select-Object Subject, Issuer, NotAfterYou should see something like this:
Status
------
Issued
Subject Issuer NotAfter
------- ------ --------
CN=intranet.saatlab.internal CN=SaatLab Root CA, DC=saatlab, DC=internal 19/10/2027 23:12:40On CL01, delete the self-signed certificate you trusted by hand back in Lesson 25, and then test:
Get-ChildItem Cert:\LocalMachine\Root | Where-Object Subject -eq 'CN=intranet.saatlab.internal' | Remove-Item
Invoke-WebRequest -Uri https://intranet.saatlab.internal -UseDefaultCredentials -UseBasicParsing | Select-Object StatusCodeYou should see this:
StatusCode
----------
200The page still opens without a warning, but now the trust comes from your CA and not from a file you imported yourself. You can do the same for the RD Web Access and RD Gateway certificates from Lesson 26 using Set-RDCertificate.
✅ Checkpoint: The intranet binding uses a certificate issued by SaatLab Root CA, and CL01 gets status 200 without the old manual trust.

4Turn on autoenrollment for workstations
In certtmpl.msc, duplicate Workstation Authentication and call it SaatLab Workstation. On Security, give Domain Computers Read, Enroll and Autoenroll, and then publish it with Add-CATemplate -Name SaatLabWorkstation -Force.
On DC01, make a GPO that switches on autoenrollment and link it to Workstations:
New-GPO -Name 'C-Cert-Autoenroll' | New-GPLink -Target 'OU=Workstations,OU=SAATLAB,DC=saatlab,DC=internal' | Out-Null
Set-GPRegistryValue -Name 'C-Cert-Autoenroll' -Key 'HKLM\Software\Policies\Microsoft\Cryptography\AutoEnrollment' -ValueName AEPolicy -Type DWord -Value 7 | Out-NullAEPolicy 7 is the same as setting Certificate Services Client – Auto-Enrollment to Enabled in the GPO, with both “Renew expired certificates” and “Update certificates that use certificate templates” ticked.
On CL01, as administrator:
gpupdate /force | Out-Null
certutil -pulse
Get-ChildItem Cert:\LocalMachine\My | Where-Object Issuer -like '*SaatLab*' | Select-Object Subject, NotAfter, @{n='Template';e={($_.Extensions | Where-Object {$_.Oid.FriendlyName -eq 'Certificate Template Information'}).Format(0).Split('(')[0]}}You should see something like this:
CertUtil: -pulse command completed successfully.
Subject NotAfter Template
------- -------- --------
CN=CL01.saatlab.internal 19/10/2027 23:20:05 Template=SaatLab WorkstationCL01 enrolled on its own and will renew itself before the year runs out. You can use the same approach to give every workstation a certificate for Wi-Fi (802.1X), VPN or IPsec without anyone filing a request by hand.
✅ Checkpoint: CL01 has a certificate from SaatLab Root CA based on the SaatLab Workstation template.
5Look at the revocation information
On CL01, as an administrator, copy the intranet certificate from SRV01 and check its chain and revocation status:
New-Item -ItemType Directory C:\Temp -Force | Out-Null
Invoke-Command -ComputerName SRV01 -ScriptBlock { Get-ChildItem Cert:\LocalMachine\My | Where-Object Subject -eq 'CN=intranet.saatlab.internal' | Sort-Object NotBefore | Select-Object -Last 1 | Export-Certificate -FilePath C:\Scripts\intranet.cer | Out-Null }
Copy-Item \\SRV01\C$\Scripts\intranet.cer C:\Temp\intranet.cer
certutil -verify -urlfetch C:\Temp\intranet.cer | Select-String 'CDP|Verified|Leaf certificate revocation|CertUtil'You should see something like this:
---------------- Certificate CDP ----------------
Verified "Base CRL (02)" Time: 0 4c8d...
[0.0] ldap:///CN=SaatLab%20Root%20CA,CN=SRV01,CN=CDP,CN=Public%20Key%20Services,CN=Services,CN=Configuration,DC=saatlab,DC=internal?certificateRevocationList?base?objectClass=cRLDistributionPoint
Leaf certificate revocation check passed
CertUtil: -verify command completed successfully.The CDP tells clients where to fetch the revocation list. In this lab it’s an LDAP path in AD, which domain members can read, but devices outside the domain need an HTTP CDP, and you’d add that on the CA before you start issuing certificates widely.
✅ Checkpoint: certutil -verify shows a reachable CDP and “Leaf certificate revocation check passed”.
Break It, Then Fix It
There are two PKI errors you’ll run into again and again: a template the CA refuses to issue, and a certificate that has been revoked.
1Break it: a template that isn’t published
On SRV01, unpublish the web server template and then try to request a certificate:
Remove-CATemplate -Name SaatLabWebServer -Force
Get-Certificate -Template SaatLabWebServer -SubjectName 'CN=test.saatlab.internal' -DnsName test.saatlab.internal -CertStoreLocation Cert:\LocalMachine\MyYou’ll get an error like this:
Get-Certificate : CertEnroll::CX509Enrollment::Enroll: Denied by Policy Module 0x80094800, The requested certificate
template is not supported by this CA. 0x80094800 (-2146875392 CERTSRV_E_UNSUPPORTED_CERT_TYPE)
+ CategoryInfo : NotSpecified: (:) [Get-Certificate], Exception
+ FullyQualifiedErrorId : System.Exception,Microsoft.CertificateServices.Commands.GetCertificateCommandThe template is still sitting in AD, but this CA isn’t offering it. CERTSRV_E_UNSUPPORTED_CERT_TYPE (0x80094800) nearly always means “not published on this CA”. If the template were published and you were missing Enroll permission, you’d get a different error that talks about permissions.
To fix it, publish the template again and retry:
Add-CATemplate -Name SaatLabWebServer -Force
(Get-Certificate -Template SaatLabWebServer -SubjectName 'CN=test.saatlab.internal' -DnsName test.saatlab.internal -CertStoreLocation Cert:\LocalMachine\My).StatusYou should see this:
Issued✅ Checkpoint: The request failed with 0x80094800 while unpublished and was Issued after Add-CATemplate.

2Break it: revoke the intranet certificate
On SRV01, revoke the current intranet certificate and publish a fresh CRL:
$serial = (Get-ChildItem Cert:\LocalMachine\My | Where-Object Subject -eq 'CN=intranet.saatlab.internal' | Sort-Object NotBefore | Select-Object -Last 1).SerialNumber
certutil -revoke $serial 4
certutil -crlReason code 4 means “superseded”. Revoking puts the serial number into the CA database, but clients only find out once you publish a CRL.
On CL01, as administrator, clear the cached CRL and check the certificate again:
certutil -urlcache crl delete | Out-Null
certutil -verify -urlfetch C:\Temp\intranet.cer | Select-String 'revoked|CertUtil'You’ll see something like this:
ERROR: Verifying leaf certificate revocation status returned The certificate is revoked. 0x80092010 (-2146885616 CRYPT_E_REVOKED)
CertUtil: The certificate is revoked.Edge on CL01 now refuses to open the intranet and shows a “certificate revoked” error. If you hadn’t cleared the cache, clients would have carried on with the old CRL until it expired, and that’s why revocation doesn’t take effect everywhere at once.
To fix it, issue a new certificate and bind it the same way you did in step 3:
$new = (Get-Certificate -Template SaatLabWebServer -SubjectName 'CN=intranet.saatlab.internal' -DnsName intranet.saatlab.internal -CertStoreLocation Cert:\LocalMachine\My).Certificate
$b = Get-WebBinding -Name Intranet -Protocol https; $b.RemoveSslCertificate(); $b.AddSslCertificate($new.Thumbprint, 'My')✅ Checkpoint: certutil reported CRYPT_E_REVOKED for the old certificate, and the intranet works again with a new one.
This happened at work
The CRL that expired over a holiday
This happened at a company whose issuing CA published a CRL that was valid for one week. Just before a two-week holiday, the host that ran the CA server was powered down for storage maintenance, and nobody noticed that the CA never came back up. On the first working day after the break the CRL had expired, and VPN connections, certificate-based Wi-Fi and several internal sites all failed with “The revocation function was unable to check revocation because the revocation server was offline” (0x80092013). Hundreds of people couldn’t connect.
Starting the CA and publishing a new CRL fixed it within an hour, but the morning was lost, and some devices cached the failure for longer.
The fix: CRLs now go to two HTTP locations as well as LDAP, with an overlap period, and monitoring raises an alert when any CRL gets within three days of expiry. The lesson: the CRL matters as much as the CA, because if clients can’t get a current one, everything that relies on certificates can stop working.
Common mistakes and troubleshooting
| Mistake or symptom | What happens | What to do instead |
|---|---|---|
| 0x80094800 CERTSRV_E_UNSUPPORTED_CERT_TYPE | The template isn’t published on that CA | Add-CATemplate on the CA |
| 0x80092013 revocation server offline | Clients can’t fetch a current CRL; services refuse certificates | Highly available CDPs, overlap, monitoring of CRL expiry |
| CA installed on a domain controller | Harder to secure and recover both | Dedicated CA servers; offline root |
| Single-tier online root CA | A compromised server means a compromised root | Offline root plus issuing CAs |
| Only LDAP CDPs | Non-domain devices can’t check revocation | Add HTTP CDP and AIA locations before issuing |
| Templates with Autoenroll for Authenticated Users | Every account gets certificates it shouldn’t | Grant to specific groups; review template permissions |
| Revoking and expecting instant effect | Clients use cached CRLs until expiry | Short CRL periods where needed, or OCSP |
| Exportable private keys everywhere | Keys can be copied off servers | Only allow export where truly needed |
| No CA backup | Lost CA key means reissuing everything | Back up the CA key and database securely |
Interview questions
Click a question to open it. Each one is worded the way an interviewer would ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.
Fresher level
1. Can you explain in simple words what a certificate authority does?
Why they ask this: Before they get into AD CS details, they want to be sure you understand the basic idea of PKI.
How you might answer: A certificate authority is a trusted service that issues digital certificates. A certificate links a public key to a name, like a server or a user, and the CA signs it, so anyone who trusts the CA can check the certificate is genuine.
2. You build an enterprise CA, and every domain computer trusts it without you doing anything on them. Why is that?
Why they ask this: They’re checking that you know how AD CS and Active Directory work together.
How you might answer: The enterprise CA publishes its certificate to Active Directory, and Group Policy then drops that certificate into the Trusted Root store on every domain member, so I don’t have to touch each machine. A device that isn’t in the domain would still need the root certificate added by hand.
3. How would you explain a certificate template to a new team member?
Why they ask this: They want to know you understand the main building block of AD CS and what it controls.
How you might answer: I’d tell them a template is a definition in AD for one type of certificate. It sets the purpose, validity period, key settings and subject, and it also controls who’s allowed to enroll or autoenroll, which is why the permissions on a template matter so much.
2–5 years experience
4. A colleague tries to request a certificate and gets CERTSRV_E_UNSUPPORTED_CERT_TYPE. What’s the likely cause and fix?
Why they ask this: This error is very common, so they want to see if you’ve troubleshot enrollment problems for real.
How you might answer: That error means the template they asked for isn’t published on that CA; it can exist in AD and still not be offered. I’d publish it with Add-CATemplate, or from the Certificate Templates folder in the CA console, and ask them to try again.
5. Walk me through how you’d make every computer in a group get and renew a certificate automatically.
Why they ask this: They want to see you know how autoenrollment works from start to finish, and not only the template part.
How you might answer: On the template I’d give that group Autoenroll along with Enroll, and then use a GPO to enable Certificate Services Client Auto-Enrollment for those computers. After that, clients enroll and renew whenever Group Policy refreshes. In my lab I run certutil -pulse to kick it off straight away instead of waiting.
6. What are CDP and AIA, and what happens if clients can’t reach them?
Why they ask this: They’re checking that you understand how clients check revocation and build the certificate chain.
How you might answer: CDP is the CRL Distribution Point, which tells clients where to download the CRL, and AIA tells them where to get the issuing CA’s certificate. Both locations are written into every certificate, and if clients can’t reach them, chain building or revocation checks can fail, so I make sure those paths stay up.
Senior level
7. Say a 5,000-user company asks you to design their PKI from scratch. What would it look like?
Why they ask this: They want to see you think in tiers and plan for security, availability and the day-to-day running of it.
How you might answer: I’d go with an offline standalone root CA and two enterprise issuing CAs, with their keys in HSMs or at least well protected. I’d publish CDP and AIA over HTTP and LDAP with high availability and add OCSP for high-volume checks. Templates would be made per use case with least-privilege enrollment rights, and I’d set up monitoring and write down the key ceremonies so the process can be repeated.
8. Your root CA certificate expires in a year. How would you renew it without breaking things?
Why they ask this: They want to know you understand the CA lifecycle and the risk of breaking every certificate that sits under it.
How you might answer: I’d start well before it expires and first decide whether to keep the same key pair or generate a new one. Then I’d publish the new root certificate to AD and to any clients that don’t get it from AD, leave the old root in place until all issued certificates chain to the new one, and update the issuing CAs last.
9. Your security team asks which AD CS attacks you worry about most. What would you tell them?
Why they ask this: They want to see that you know the real AD CS attack paths, like the ESC-style issues, and how to cut them down.
How you might answer: I’d bring up templates that let users supply their own subject, which is the ESC1 problem, and enrollment rights that are far too broad, plus vulnerable web enrollment endpoints and NTLM relay to AD CS. To defend against them I’d audit the templates, require manager approval on the sensitive ones, and enforce HTTPS and EPA on the web enrollment endpoints.
Quick quiz
Q1. What kind of CA integrates with AD and supports templates?
- Standalone CA
- Enterprise CA
- Public CA
Show answer
B — It also publishes itself to AD.
Q2. What did 0x80094800 mean in Break It step 1?
- Wrong password
- The template wasn’t published on the CA
- The CA was offline
Show answer
B — Publish it with Add-CATemplate.
Q3. What does AEPolicy 7 in the GPO do?
- Disables enrolment
- Turns on autoenrollment with renewal and updates
- Deletes certificates
Show answer
B — Same as the Auto-Enrollment policy setting.
Q4. What error did certutil show after revocation?
- CRYPT_E_REVOKED
- Access denied
- Template not found
Show answer
A — Clients refuse revoked certificates.
Q5. In the work story, what stopped VPN and Wi-Fi?
- A virus
- An expired CRL while the CA was offline
- A new template
Show answer
B — Keep CRLs available and monitored.
Quick recap
- Active Directory Certificate Services runs a CA of your own that domain members trust automatically.
- Use an enterprise CA with templates, and in production use an offline root with separate issuing CAs.
- A CA only issues published templates (
Add-CATemplate). - Request with
Get-Certificate, or autoenroll with a GPO andcertutil -pulse. - Revocation only works if clients can reach a current CRL, and you can check that with
certutil -verify -urlfetch. - 0x80094800 means template not published; 0x80092013 means the CRL can’t be checked.
Next lesson
Lesson 35: AD on Server 2025 and DC migration → Next you’ll see what’s new for domain controllers in Server 2025, raise the functional levels, plan a DC migration, move the FSMO roles to a new DC and retire the old one cleanly.
Further reading: Active Directory Certificate Services
Want to go deeper into Active Directory Certificate Services? Microsoft’s AD CS overview explains the role, and the Install-AdcsCertificationAuthority reference lists every option used here. You can also see the full plan for this course on the Windows Server Administration course page.
