When domain controllers are taken offline without being demoted first, the domain metadata is still left in Active Directory. This article illustrates how to remove that domain metadata with the help of NTDSUTIL utility.

Open PowerShell with elevated privileges and execute the following commands in sequence.

Step 1. Type ntdsutil and hit enter from keyboard

Step 2. Type metadata cleanup and hit enter from keyboard

Step 3. Type connections and hit enter from keyboard

Step 4. Type connect to server <NetBIOS or DNS name of any domain controller of the domain you would like to delete failed DC from>

Step 5. Type q and hit enter from keyboard

Step 6. Type select operation target and hit enter from keyboard

Step 7. Type list domains and hit enter from keyboard

Step 8. Type select domain <domain number associated with domain to be removed> and hit enter from keyboard

Step 9. Type q and hit enter from keyboard

Step 11. Ignore the warning and click Yes

At this point the domain should have been removed. You can quit ntdsutil utility. If you would like to remove more domains, go back to step 6 and start the whole process again.