How-To: Demote a DC or manually remove a DC
July 13 2010
Caution: Using the ntdsutil or adsiedit incorrectly may result in partial or complete loss of Active Directory functionality!
Pre-demotion check list
- Verify that the DC is not the only GC (global catalog) server and does not hold a FSMO (operations master role)
- Verify that the DC is not the only DC in the domain
- Verify proper replication is happening
- Check event logs for errors and trouble shoot accordingly
Demote DC – CLEAN
- Run dcpromo and follow the wizard
- Let some AD replicate then check AD and DNS to confirm DC was properly removed (see “FORCED” removal for areas to check
Demote DC – FORCED (W2K3SP1 or later – assuming the clean method has failed for some reason)
- Force demote by running “dcpromo /forceremoval” – this will remove the DC without contacting the other domain controllers – it will also put the DC into workgroup mode (will remove it from the domain)
- Run the MetaCleaner.vbs script (not detailed here)
- Clean up AD
- From a good DC, run ntdsutil
- Type metadata cleanup
- Type connections
- Type connect to server <servername>
- Type q
- Type select operation target
- Type list domains
- Type select domain <number>
- Type list sites
- Type select site <number>
- Type list servers in site
- Type select server
- Type q
- Type remove selected server (if you get error 8419 “the dsa object could not be found”, the object was already removed)
- Type q until exited
- Delete the computer account
- Delete the computer object in AD
- Check ADSIEdit to confirm removal
- Run ADSIEdit.
- Expand the Domain NC container
- Expand DC=<domain>, DC=<name>
- Expand OU=Domain Controllers.
- Right-click CN=
then click delete (you may have to delete child objects to remove the server object)
- FRS member object (FRS subscriber object should already be deleted with computer object)
- Check ADSIEdit to confirm removal
- Run ADSIEdit.
- Expand the Domain NC container
- Expand DC=<domain>, DC=<name>
- Expand CN=System
- Expand CN=File Replication Service
- Expand CN=Domain System Volume (SYSVOL share)
- Right-click the domain controller you are removing then click delete
- Clean up DNS
- Remove the cname record in the _msdcs.root domain of forest zone in DNS
- Delete the host name and other DNS records associated with the server (include reverse pointer records)
- If this was also a DNS server, remove the reference to this DC under the DNS servers Name Servers tab
- If the deleted computer is the last domain controller in a child domain, and the child domain was also deleted, use ADSIEdit to delete the trustDomain object for the child (not detailed here)
- Delete the DC from Active Directory Sites and Services > Sites