Decomissioning an AD CS Certificate Authority
A walkthrough on how to decomission an AD CS Certificate Authority and perform AD cleanup.
Introduction
This document provides work instructions for decommissioning an issuing Certificate Authority (CA) fully, cleanly, and removing any trace of it in Active Directory (AD)
Pre-Requisites
Before touching anything:
- Confirm it is ready for decommission
- No longer issuing certificates
- No certificates still needed for authentication and / or decryption
- Confirm the engineer performing this activity has domain administrator and enterprise administrator rights.
Instructions
Stop AD CS and Revoke Issuing CA Certificate
- Stop Active Directory Certificate Service (ADCS) by typing
net stop certsvcin an administrative command prompt. - From the Root or Policy CA (depending on hierarchical architecture), revoke the issuing CA’s certificate.
- Log onto the Policy CA
- Open the Certification Authority Console by typing
certsrv.mscin the Run menu - Expand the CA name
- Navigate to “Issued Certificates” and locate the issuing CA’s certificate
- Right click > All Tasks > Revoke
- Specify the reason as
CessationOfOperation
- Then republish the CRL
- Open the Certification Authority Console by typing
certsrv.mscin the Run menu - Expand the CA name
- In the left pane, right click “Revoked Certificates” > All Tasks > Publish
- Open the Certification Authority Console by typing
Uninstall AD CS
- To uninstall the CA Role, follow the steps below:
- Open the Server Manager application
- Under Roles Summary, select Remove Roles to start the remove roles wizard, and then select Next
- Select to clear the Active Directory Certificate Services check box, and then select Next
- On the Confirm Removal options page, review the information, and then select Remove
- Once the remove roles wizard is finished, restart the server.
Scrub Active Directory
When AD CS is installed on a domain-joined server, several objects are created in the Configuration container in Active Directory, namely:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- certificateAuthority object
- Located in CN=AIA,CN=Public Key Services,CN=Services,CN=Configuration,DC=ForestRootDomain.
- Contains the CA certificate for the CA.
- Published Authority Information Access (AIA) location.
- crlDistributionPoint object
- Located in CN=ServerName,CN=CDP,CN=Public Key Service,CN=Services,CN=Configuration,DC=ForestRoot,DC=com.
- Contains the CRL periodically published by the CA.
- Published CRL Distribution Point (CDP) location.
- certificationAuthority object
- Located in CN=Certification Authorities,CN=Public Key Services,CN=Services,CN=Configuration,DC=ForestRoot,DC=com.
- Contains the CA certificate for the CA.
- pKIEnrollmentService object
- Located in CN=Enrollment Services,CN=Public Key Services,CN=Services,CN=Configuration,DC=ForestRoot,DC=com.
- Created by the enterprise CA.
- Contains information about the types of certificates the CA has been configured to issue. Permissions on this object can control which security principals can enroll against this CA.
When the CA is uninstalled, only the pKIEnrollmentService object is removed.
To Scrub Active directory, go through each of the locations detailed above and delete any entries relating to the CA to be decommissioned
Also delete any certificates that have been published to AD using the following command:
1
certutil -viewdelstore "ldap:///CN=NtAuthCertificates,CN=Public Key Services,CN=Services,CN=Configuration,DC=ForestRoot,DC=com?cACertificate?base?objectclass=certificationAuthority"
Remove from Domain
As this CA was domain-joined, it should be removed from the domain before being physically decomissioned. The steps below detail the process of removing the CA server from the AD domain.
- Open System Properties by typing
sysdm.cplin the Run menu - Click Change
- Tick the Workgroup tick box
- In the Workgroup input field, type
WORKGROUP - Press OK, dismissing any welcome message.
- Log onto the Domain Controller and open Active Directory Users and Computers by typing
dsa.mscin the Run menu - Navigate to the OU which held the decomissioned CA server
- Right Click > Delete the CA Server.
Clean up Domain Controllers
After the CA is uninstalled, the certificates that were issued to domain controllers must be removed.
To remove certificates that were issued to the Windows Server 2003 and newer domain controllers, follow these steps. Do not use this procedure if you are using certificates that are based on version 1 domain controller templates.
- Select Start, select Run, type
cmd, and then press ENTER. At the command prompt on a domain controller, type
certutil -dcinfo deleteBad.Certutil.exe tries to validate all the DC certificates that are issued to the domain controllers. Certificates that do not validate are removed.
To force application of the group policy, follow these steps:
- Select Start, select Run, type
cmdin the Open box, and then press ENTER. At a command prompt, type the following command, and then press ENTER:
1
gpupdate /force