‘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 cleanup
command and press enter. - At the metadata cleanup prompt, type
connections
and press enter. - At the server connections prompt, type
connect to server ws2012r2
and 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 cleanup
prompt. - Now at the
metadata cleanup
prompt, typeselect operation target
and 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 target
typeselect domain 0
. Where domain 0 is the intended domain. - At the next
select operation target
prompt, type list sites and press enter. - At the next
select operation target
prompt, typeselect site 0
and press enter. - At the next
select operation target
prompt, typelist servers in site
and press enter. - At the next
select operation target
prompt, typeselect server 1
where server 1 is the offline domain controller object I intend to remove. Press enter. - At the next
select operation target
prompt, typequit
to exit out to themetadata cleanup
prompt. - At the next
metadata cleanup
prompt, 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.