‘Dcpromo’ is used to install and uninstall Domain controllers, however if domain controllers is crash and unable to run dcpromo scenarios for uninstall, it’s indeed to use manual way to clean metadata from the active directory.
Below is discussing the step by step process
First thing need to check failed DC’s are holding any FSMO roles. If its holding FSMO, require to seize fsmo role to other domain controllers.
The next step is clean server metadata from active directory database. There are three methods to cleanup and my choice always using command line
Method 2: Clean up server metadata using the command line
Running the repadmin /replsum command confirmed a replication error and showed DC1 as unavailable:
Method 2:
Start the Ntdsutil Tool:
Open a command prompt as an administrator. At the prompt, type ntdsutil and press enter. This put me directly in the ntdsutil mode. Entering ‘help’ shows all the options directly available :
- At the Ntdsutil prompt, select and type
metadata cleanupcommand and press enter. - At the metadata cleanup prompt, type
connectionsand press enter. - At the server connections prompt, type
connect to server ws2012r2and press enter. Where ws2012r2 is a domain controller dns name. - After connecting to the domain controller, type quit at the server connections prompt to exit out to the
metadata cleanupprompt. - Now at the
metadata cleanupprompt, typeselect operation targetand press enter. Entering this mode, will enable me select the sites, domains and servers I intend to work with. - From the help options available at
select operation target, select, and typelist domains. Press enter. - At the
select operation targettypeselect domain 0. Where domain 0 is the intended domain. - At the next
select operation targetprompt, type list sites and press enter. - At the next
select operation targetprompt, typeselect site 0and press enter. - At the next
select operation targetprompt, typelist servers in siteand press enter. - At the next
select operation targetprompt, typeselect server 1where server 1 is the offline domain controller object I intend to remove. Press enter. - At the next
select operation targetprompt, typequitto exit out to themetadata cleanupprompt. - At the next
metadata cleanupprompt, typeRemove selected server. - At the ‘Server Remove Confirmation Dialog’, click yes to remove the failed Domain Controller server object.After the removal is successful, I exit out of the ntdsutil tool by typing quit all the way up. I ran the repadmin /replsummary command again to verify and the result shows no replication errors.
We still had to go into the DNS forward lookup and reverse lookup zones to manually remove references to the offline domain controller object.
