{"id":202,"date":"2018-03-02T19:51:25","date_gmt":"2018-03-03T01:51:25","guid":{"rendered":"http:\/\/zewwy.ca\/?p=202"},"modified":"2018-07-20T14:17:23","modified_gmt":"2018-07-20T19:17:23","slug":"remove-existing-enterprise-root-ca-part-2","status":"publish","type":"post","link":"https:\/\/zewwy.ca\/index.php\/2018\/03\/02\/remove-existing-enterprise-root-ca-part-2\/","title":{"rendered":"Remove Existing Enterprise Root CA (Part 2)"},"content":{"rendered":"<h1 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Intro\"><\/span><strong>Intro<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>Continuing on from my <a href=\"https:\/\/stealthpuppy.com\/deploy-enterprise-subordinate-certificate-authority\/#.Wm9sN6inE-U\">source blog post<\/a>. In this case he goes on to install and configure the role to be a subordinate enterprise CA. But what do you do if you already deployed an Enterprise Root CA? I&#8217;m going to go off a hunch and that something gets applied into AD somewhere to present this information to domain clients. I found <a href=\"https:\/\/support.microsoft.com\/en-ca\/help\/889250\/how-to-decommission-a-windows-enterprise-certification-authority-and-r\">this nice article from MS directly<\/a> on the directions to take, it stated for Server 2012, so I hope the procedure on this hasn&#8217;t changed much in 2016.<\/p>\n<p>*NOTE* All steps that state need to be done to AD objects, those commands are run as a Domain Admin, or Enterprise Admin directly logged onto those servers. Most other commands or steps will be done via a client system MMC Snap-in, or logged directly into the CA server.<\/p>\n<h1 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Remove_Existing_Enterprise_Root_CA\"><\/span><strong>Remove Existing Enterprise Root CA<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h1>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Revoke_Existing_Certificates\"><\/span><strong>Revoke Existing Certificates<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: left;\"><strong><em>Step 1: Revoke all active certificates that are issued by the enterprise CA<\/em><\/strong><\/p>\n<ol>\n<li><em>Click <\/em><em><strong>Start<\/strong><\/em><em>, point to<\/em><br \/>\n<em><strong>Administrative Tools<\/strong><\/em><em>, and then click <\/em><em><strong>Certification Authority<\/strong><\/em><em>.<\/em><\/li>\n<li><em>Expand your CA, and then click the <\/em><em><strong>Issued Certificates<\/strong><\/em><em> folder.<\/em><\/li>\n<li><em>In the right pane, click one of the issued certificates, and then press CTRL+A to select all issued certificates.<\/em><\/li>\n<li><em>Right-click the selected certificates, click <\/em><em><strong>All Tasks,<\/strong><\/em><em> and then click <\/em><em><strong>Revoke Certificate<\/strong><\/em><em>.<\/em><\/li>\n<li><em>In the <\/em><em><strong>Certificate Revocation<\/strong><\/em><em> dialog box, click to select <\/em><em><strong>Cease of Operation<\/strong><\/em><em> as the reason for revocation, and then click <\/em><em><strong>OK<\/strong><\/em><em>.<\/em><\/li>\n<\/ol>\n<p>Simple enough&#8230;<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/xQVACWf.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/xQVACWf.png\" alt=\"\" width=\"1020\" height=\"429\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/Z7mvIHq.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/Z7mvIHq.png\" alt=\"\" width=\"317\" height=\"233\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><strong>Increase the CRL interval<\/strong><\/p>\n<p style=\"text-align: center;\"><strong><em>Step 2: Increase the CRL publication interval<\/em><\/strong><\/p>\n<ol>\n<li><em>In the Certification Authority Microsoft Management Console (MMC) snap-in, right-click the <\/em><em><strong>Revoked Certificates<\/strong><\/em><em> folder, and then click <\/em><em><strong>Properties<\/strong><\/em><em>.<\/em><\/li>\n<li><em>In the <\/em><em><strong>CRL Publication Interval<\/strong><\/em><em> box, type a suitably long value, and then click <\/em><em><strong>OK<\/strong><\/em><em>.<\/em><\/li>\n<\/ol>\n<p><em>Note The lifetime of the Certificate Revocation List (CRL) should be longer than the lifetime that remains for certificates that have been revoked.<\/em><\/p>\n<p>Easy enough, done and done.<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/Ow9npHx.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/Ow9npHx.png\" alt=\"\" width=\"405\" height=\"467\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><strong><em>Step 3: Publish a new CRL<\/em><\/strong><\/p>\n<ol>\n<li style=\"text-align: left;\"><em>In the Certification Authority MMC snap-in, right-click the<\/em><br \/>\n<em><strong>Revoked Certificates<\/strong><\/em><em> folder.<\/em><\/li>\n<li style=\"text-align: left;\"><em>Click <\/em><em><strong>All Tasks<\/strong><\/em><em>, and then click<\/em><br \/>\n<em><strong>Publish<\/strong><\/em><em>.<\/em><\/li>\n<li style=\"text-align: left;\"><em>In the <\/em><em><strong>Publish CRL<\/strong><\/em><em> dialog box, click<\/em><br \/>\n<em><strong>New CRL<\/strong><\/em><em>, and then click <\/em><em><strong>OK<\/strong><\/em><em>.<\/em><\/li>\n<\/ol>\n<p>Again easy, done.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Deny_Pending_Requests\"><\/span>Deny Pending Requests<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>*DEFAULT, generally Not required.<\/p>\n<p style=\"text-align: center;\"><strong><em>Step 4: Deny any pending requests<\/em><\/strong><\/p>\n<p><em>By default, an enterprise CA does not store certificate requests. However, an administrator can change this default behavior. To deny any pending certificate requests, follow these steps:<\/em><\/p>\n<ol>\n<li><em>In the Certification Authority MMC snap-in, click the Pending Requests folder.<\/em><\/li>\n<li><em>In the right pane, click one of the pending requests, and then press CTRL+A to select all pending certificates.<\/em><\/li>\n<li><em>Right-click the selected requests, click <\/em><em><strong>All Tasks<\/strong><\/em><em>, and then click <\/em><em><strong>Deny Request<\/strong><\/em><em>.<\/em><\/li>\n<\/ol>\n<p>Not the case for me.<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Uninstall_Certificate_Services\"><\/span><strong>Uninstall Certificate Services<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: center;\"><strong><em>Step 5: Uninstall Certificate Services from the server<\/em><\/strong><\/p>\n<ol>\n<li><em>To stop Certificate Services, click <\/em><em><strong>Start<\/strong><\/em><em>, click <\/em><em><strong>Run<\/strong><\/em><em>, type cmd, and then click <\/em><em><strong>OK<\/strong><\/em><em>.<\/em><\/li>\n<li><em>At the command prompt, type certutil -shutdown, and then press Enter.<\/em><\/li>\n<li><em>At the command prompt, type<\/em><br \/>\n<em>certutil -key, and then press Enter. This command will display the names of all the installed cryptographic service providers (CSP) and the key stores that are associated with each provider. Listed among the listed key stores will be the name of your CA. The name will be listed several times, as shown in the following example:<\/em><\/li>\n<\/ol>\n<p><em>(1)Microsoft Base Cryptographic Provider v1.0:<\/em><br \/>\n<em>  <\/em><em>1a3b2f44-2540-408b-8867-51bd6b6ed413<\/em><br \/>\n<em>  <\/em><em>MS IIS DCOM ClientSYSTEMS-1-5-18<\/em><br \/>\n<em>  <\/em><em>MS IIS DCOM Server<\/em><br \/>\n<em>  <\/em><em>Windows2000 Enterprise Root CA<\/em><br \/>\n<em>  <\/em><em>MS IIS DCOM ClientAdministratorS-1-5-21-436374069-839522115-1060284298-500<\/em><\/p>\n<ol start=\"4\">\n<li><em>Delete the private key that is associated with the CA. To do this, at a command prompt, type the following command, and then press Enter:<\/em><\/li>\n<\/ol>\n<p><em>certutil -delkey <\/em><em><strong>CertificateAuthorityName<\/strong><\/em><\/p>\n<p><em>Note If your CA name contains spaces, enclose the name in quotation marks. <\/em><\/p>\n<p><em>In this example, the certificate authority name is &#8220;Windows2000 Enterprise Root CA.&#8221; Therefore, the command line in this example is as follows:<\/em><\/p>\n<p><em>certutil -delkey &#8220;Windows2000 Enterprise Root CA&#8221;<\/em><\/p>\n<p>* OK, this is where things got weird for me. For some reason I wasn&#8217;t getting back the same type of results as the guide, instead I got this:<\/p>\n<p>C:\\ProgramData\\Microsoft\\Crypto\\RSA&gt;certutil \u2013key<br \/>\nMicrosoft Strong Cryptographic Provider:<br \/>\nTSSecKeySet1<br \/>\nf686aace6942fb7f4566yh1212eef4a4_ae5889t-54c3-4b6f-8b60-f9f8471c0525<br \/>\nRSA<br \/>\nAT_KEYEXCHANGE<\/p>\n<p>CertUtil: -key command completed successfully.<\/p>\n<p>And any attempt to delete the key based on the known CA name just failed. <a href=\"https:\/\/social.technet.microsoft.com\/Forums\/en-US\/9353487b-a05c-4cdf-846d-5ca32921c640\/certutil-delkey-caname-fails?forum=winserversecurity\">I asked about this<\/a> in TechNet under the security section, and was told basically what I figured and that the key either didn&#8217;t exist or was corrupted. So basically continue on with the steps. It was later answered by Mark Cooper.<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Locating_the_CA_Master_Key\"><\/span><strong>Locating the CA Master Key<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>This one again got answered by Mark Cooper, include \u2013csp ksp (keys are located under: %allusersprofile%\\Microsoft\\Crypto\\Keys)<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/Rg9iTBn.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/Rg9iTBn.png\" alt=\"\" width=\"910\" height=\"586\" \/><\/a><\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Deleting_the_CA_Master_Key\"><\/span><strong>Deleting the CA Master Key<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>From all the research I&#8217;ve done, it seems people are adamant that you delete the key before you remove the certs, why exactly I&#8217;m not sure&#8230;(From my testing if you deleted the certificate via certutil, it comes right back when restarting certsvc. It must be rebuilt from the registry?)<\/p>\n<p>So: certutil \u2013csp ksp \u2013delkey &lt;key&gt;<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/Tbr6woY.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/Tbr6woY.png\" alt=\"\" width=\"932\" height=\"112\" \/><\/a><\/p>\n<p>Checking the keys directory show empty. Good stuff.<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Viewing_the_Certificate_store\"><\/span><strong>Viewing the Certificate store<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Certutil \u2013store  my<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/kwe8Bvr.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/kwe8Bvr.png\" alt=\"\" width=\"875\" height=\"381\" \/><\/a><\/p>\n<p>This made me start to wonder where the actual certificate files were stored, a <a href=\"https:\/\/superuser.com\/questions\/411909\/where-is-the-certificate-folder-in-windows-7\">google away<\/a> and it turns out to be in the registry? Lol (HKLM\\System\\Microsoft\\SystemCertificates)<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/KWrQJMY.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/KWrQJMY.png\" alt=\"\" width=\"763\" height=\"552\" \/><\/a><\/p>\n<div>You can see they key container name matches the certificate hash.<\/div>\n<div><\/div>\n<p>Nothing more than just a string of obfuscated code (much like opening up a CSR), so the only way to interact with them is using the Microsoft CryptoAPI (CertUtil), or the Snap-in.<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Deleting_the_CA_Certificate\"><\/span><strong>Deleting the CA Certificate<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Certutil \u2013delstore my &lt;Serial&gt;<\/p>\n<p>Reopening regedit, and the cert is gone.<\/p>\n<p><strong>Delete Trusted Root CA Cert<\/strong><\/p>\n<p>Certutil \u2013store ca<br \/>\nCertutil \u2013delstore ca &lt;serial&gt;<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/JqBbSTX.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/JqBbSTX.png\" alt=\"\" width=\"859\" height=\"83\" \/><\/a><\/p>\n<p>So moving on\u2026*<\/p>\n<ol start=\"5\">\n<li><em>List the key stores again to verify that the private key for your CA was deleted.<\/em><br \/>\nCheck<\/li>\n<li><em>After you delete the private key for your CA, uninstall Certificate Services. To do this, follow these steps, depending on the version of Windows Server that you are running.<br \/>\n<\/em><\/p>\n<p style=\"text-align: center;\"><em>Uninstall-AdcsCertificationAuthority<\/em><\/p>\n<p><em>If the remaining role services, such as the Online Responder service, were configured to use data from the uninstalled CA, you must reconfigure these services to support a different CA. After a CA is uninstalled, the following information is left on the server:<\/em><\/li>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><em>The CA database (To be deleted see below)<\/em><\/li>\n<li><em>The CA public and private keys (Deleted see above)<\/em><\/li>\n<li><em>The CA&#8217;s certificates in the Personal store (Deleted See above)<\/em><\/li>\n<li><em>The CA&#8217;s certificates in the shared folder, if a shared folder was specified during AD CS setup (N\/A)<\/em><\/li>\n<li><em>The CA chain&#8217;s root certificate in the Trusted Root Certification Authorities store (Deleted See Above)<\/em><\/li>\n<li><em>The CA chain&#8217;s intermediate certificates in the Intermediate Certification Authorities store (none existed for me)<\/em><\/li>\n<li><em>The CA&#8217;s CRL (yup)<\/em><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><em>By default, this information is kept on the server in case you are uninstalling and then reinstalling the CA. For example, you might uninstall and reinstall the CA if you want to change a stand-alone CA to an enterprise CA.<\/em><\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Known_AD_CA_Objects\"><\/span><strong>Known AD CA Objects<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: center;\"><strong><em>Step 6: Remove CA objects from Active Directory<\/em><\/strong><\/p>\n<p><em>When Microsoft Certificate Services is installed on a server that is a member of a domain, several objects are created in the configuration container in Active Directory. <\/em><\/p>\n<p><em>These objects are as follows:<\/em><\/p>\n<ul>\n<li><em>certificateAuthority object<\/em>\n<ul>\n<li><em>Located in CN=AIA,CN=Public Key Services,CN=Services,CN=Configuration,DC=<\/em><em><strong>ForestRootDomain<\/strong><\/em><em>.<\/em><\/li>\n<li><em>Contains the CA certificate for the CA.<\/em><\/li>\n<li><em>Published Authority Information Access (AIA) location.<\/em><\/li>\n<\/ul>\n<\/li>\n<li><em>crlDistributionPoint object<\/em>\n<ul>\n<li><em>Located in CN=<\/em><em><strong>ServerName<\/strong><\/em><em>,CN=CDP,CN=Public Key Service,CN=Services,CN=Configuration,DC=<\/em><em><strong>ForestRoot<\/strong><\/em><em>,DC=com.<\/em><\/li>\n<li><em>Contains the CRL periodically published by the CA.<\/em><\/li>\n<li><em>Published CRL Distribution Point (CDP) location<\/em><\/li>\n<\/ul>\n<\/li>\n<li><em>certificationAuthority object<\/em>\n<ul>\n<li><em>Located in CN=Certification Authorities,CN=Public Key Services,CN=Services,CN=Configuration,DC=<\/em><em><strong>ForestRoot<\/strong><\/em><em>,DC=com.<\/em><\/li>\n<li><em>Contains the CA certificate for the CA.<\/em><\/li>\n<\/ul>\n<\/li>\n<li><em>pKIEnrollmentService object<\/em>\n<ul>\n<li><em>Located in CN=Enrollment Services,CN=Public Key Services,CN=Services,CN=Configuration,DC=<\/em><em><strong>ForestRoot<\/strong><\/em><em>,DC=com.<\/em><\/li>\n<li><em>Created by the enterprise CA.<\/em><\/li>\n<li><em>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.<\/em><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><em>When the CA is uninstalled, only the pKIEnrollmentService object is removed. This prevents clients from trying to enroll against the decommissioned CA. The other objects are retained because certificates that are issued by the CA are probably still outstanding. These certificates must be revoked by following the procedure in the &#8220;Step 1: Revoke all active certificates that are issued by the enterprise CA&#8221; section. <\/em><\/p>\n<p><em>For Public Key Infrastructure (PKI) client computers to successfully process these outstanding certificates, the computers must locate the Authority Information Access (AIA) and CRL distribution point paths in Active Directory. It is a good idea to revoke all outstanding certificates, extend the lifetime of the CRL, and publish the CRL in Active Directory. If the outstanding certificates are processed by the various PKI clients, validation will fail, and those certificates will not be used. <\/em><\/p>\n<p><em>If it is not a priority to maintain the CRL distribution point and AIA in Active Directory, you can remove these objects. Do not remove these objects if you expect to process one or more of the formerly active digital certificates.<\/em><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Remove_all_Certification_Services_objects_from_Active_Directory\"><\/span><strong>Remove all Certification Services objects from Active Directory<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><em>To remove all Certification Services objects from Active Directory, follow these steps:<\/em><\/p>\n<ol>\n<li>Know the CA common name (use CertUtil)<\/li>\n<li>Use Sites and Service MMC Snap-in from a client computer using a domain admin account with proper permissions, highlight the parent snap-in node -&gt; View (from the toolbar) -&gt; Show Services Node.<\/li>\n<li>Expand Services, expand Public Key Services, and then click the AIA folder.<\/li>\n<li>In the right pane, right-click the CertificationAuthority object for your CA, click Delete, and then click \u201cYes&#8221;.<\/li>\n<li>Left Nav, Click CDP folder.<\/li>\n<li>In the right pane, right-click the CertificationAuthority object for your CA, click Delete, and then click \u201cYes&#8221;.<\/li>\n<li>Left Nav, Click Certificate Authority.<\/li>\n<li>In the right pane, right-click the CertificationAuthority object for your CA, click Delete, and then click Yes.<\/li>\n<li>Left Nav, Click Enrollment Services (This should have been auto removed, in my case it was)<\/li>\n<li>If you did not locate all the objects, some objects may be left in the Active Directory after you perform these steps. To clean up after a CA that may have left objects in Active Directory, follow these steps to determine whether any AD objects remain:\n<ol>\n<li>Type the following command at a command line, and then press ENTER:\n<ol>\n<li>ldifde -r &#8220;cn=CACommonName&#8221; -d &#8220;CN=Public Key Services,CN=Services,CN=Configuration,DC=ForestRoot,DC=com&#8221; -f output.ldf<\/li>\n<\/ol>\n<\/li>\n<li>In this command, CACommonName represents the Name value that you determined in step 1. For example, if the Name value is &#8220;CA1 Contoso,&#8221; type the following:\n<ol>\n<li>ldifde -r &#8220;cn=CA1 Contoso&#8221; -d &#8220;cn=public key services,cn=services,cn=configuration,dc=contoso,dc=com&#8221; -f remainingCAobjects.ldf<\/li>\n<\/ol>\n<\/li>\n<li>Open the remainingCAobjects.ldf file in Notepad. Replace the term &#8220;changetype: add&#8221; with &#8220;changetype: delete.&#8221; Then, verify whether the Active Directory objects that you will delete are legitimate.<\/li>\n<li>At a command prompt, type the following command, and then press ENTER to delete the remaining CA objects from Active Directory:\n<ol>\n<li>ldifde -i -f remainingCAobjects.ldf<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>At this point I was having issues with the input command of the ldf file was failing. I posted these results in my Technet post. After a bit more research I noticed other examples online not having any other information appended after the \u201cchangetype: delete&#8221; line. So I simply followed along and did the same deleting all the lines after that one, leaving the base DN object in place and sure enough it finally succeeded.<\/p>\n<p>Generate base object LDF file:<\/p>\n<div><\/div>\n<p>After editing line as specified in MS article:<\/p>\n<div><\/div>\n<p>New altered LDF file:<\/p>\n<div><\/div>\n<p>Same command after altering file:<\/p>\n<div><\/div>\n<p>Second run I simply deleted the object under the KRA folder, and it returns no values.<\/p>\n<p>13) Delete the certificate templates if you are sure that all of the certificate authorities have been deleted. Repeat step 12 to determine whether any AD objects remain.<\/p>\n<p>I did this via the Site and Service Snap-in, under the PKI section of the Services node.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Delete_NTAuthCertificates_Objects_Published_Certificates\"><\/span><strong>Delete NTAuthCertificates Objects Published Certificates<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong><em>Step 7: Delete certificates published to the NtAuthCertificates object<\/em><\/strong><\/p>\n<p><em>After you delete the CA objects, you have to delete the CA certificates that are published to the NtAuthCertificates object. Use either of the following commands to delete certificates from within the NTAuthCertificates store:<\/em><\/p>\n<p><em>certutil -viewdelstore &#8220;ldap:\/\/\/CN=NtAuthCertificates,CN=Public Key <\/em><br \/>\n<em>Services,&#8230;,DC=ForestRoot,DC=com?cACertificate?base?objectclass=certificationAuthority&#8221;<\/em><\/p>\n<p><em>certutil -viewdelstore &#8220;ldap:\/\/\/CN=NtAuthCertificates,CN=Public Key <\/em><br \/>\n<em>Services,&#8230;,DC=ForestRoot,DC=com?cACertificate?base?objectclass=pKIEnrollmentService&#8221;<\/em><\/p>\n<p><em>Note You must have Enterprise Administrator permissions to perform this task.<\/em><\/p>\n<p><em>The -viewdelstore action invokes the certificate selection UI on the set of certificates in the specified attibute. You can view the certificate details. You can cancel out of the selection dialog to make no changes. If you select a certificate, that certificate is deleted when the UI closes and the command is fully executed<\/em><\/p>\n<p><em>Use the following command to see the full LDAP path to the NtAuthCertificates object in your Active Directory:<\/em><\/p>\n<p><em>certutil store -? | findstr &#8220;CN=NTAuth&#8221;<\/em><\/p>\n<p>Nice and easy, finally.<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Delete_the_CA_Database\"><\/span><strong>Delete the CA Database<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong><em>Step 8: Delete the CA database<\/em><\/strong><\/p>\n<p><em>When Certification Services is uninstalled, the CA database is left intact so that the CA can be re-created on another server.<\/em><\/p>\n<p><em>To remove the CA database, delete the %systemroot%\\System32\\Certlog folder.<\/em><\/p>\n<p>Nice and easy, I like these steps.<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Clean_up_the_DCs\"><\/span><strong>Clean up the DC&#8217;s<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong><em>Step 9: Clean up domain controllers<\/em><\/strong><\/p>\n<p><em>After the CA is uninstalled, the certificates that were issued to domain controllers must be removed. <\/em><\/p>\n<p><em>Which states for 2003 and up:<\/em><\/p>\n<p><em>certutil -dcinfo deleteBad<\/em><\/p>\n<p>My results:<\/p>\n<p>With the same list of garbage for the DC, then rerunning Certutil \u2013dcinfo, still reported the same certs\u2026 So I had to manually remove these, but again opening a MMC snap-in via a client system, add the certificate snap-in and point to the machine store on the DC&#8217;s. Then manually delete the certificates, once this was done for both DC&#8217;s. CertUtil \u2013dcinfo finally reported clean\u2026<\/p>\n<h1 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span><strong>Summary<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>Finally!!! What a gong show it is to remove an existing CA from an environment\u2026 even one that literally wasn&#8217;t used for anything outside its initial deployment as an enterprise root CA.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Intro Continuing on from my source blog post. In this case he goes on to install and configure the role to be a subordinate enterprise CA. But what do you do if you already deployed an Enterprise Root CA? I&#8217;m going to go off a hunch and that something gets applied into AD somewhere to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/zewwy.ca\/index.php\/2018\/03\/02\/remove-existing-enterprise-root-ca-part-2\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Remove Existing Enterprise Root CA (Part 2)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","footnotes":""},"categories":[4,8],"tags":[27,18,17,25],"class_list":["post-202","post","type-post","status-publish","format-standard","hentry","category-infosec","category-server-administration","tag-certificate-authority","tag-certificates","tag-pki","tag-security"],"_links":{"self":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/comments?post=202"}],"version-history":[{"count":15,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/202\/revisions"}],"predecessor-version":[{"id":307,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/202\/revisions\/307"}],"wp:attachment":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/media?parent=202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/categories?post=202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/tags?post=202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}