Wednesday, 15 August 2012

How to remove non-existent domain from Active Directory


I just installed a second domain controller in our environment. My predecessor didn't replace the second DC when it went faulty a year back. I noticed something weird is happening. The DC2 couldn't serve as a Global Catalog server, I have got many errors in the Event Viewer, in particular Event 1202 and Event 1926 like the screenshots below.





From the second screenshot, I could pinpoint the issue lies on non-existent child domain. For whatever reason, the server was taken out without properly demoting it. So the steps that are taken next are as below:



  1. Run ntdsutil from command prompt
  2. Type metadata cleanup
  3. Type connections
  4. Type connect to server <servername>
  5. Type quit
  6. Type select operation target
  7. Type list domains
  8. Type select domain <enter the number of you want to remove>
  9. Type quit
  10. Type remove selected domain
  11. If you don't get an error 0x2012 like the screenshot below, you have successfully removed the non-existent domain. Just type quit twice to get out of the utility.
  12. If you encounter this 0x2012 error, then do step 13 onward.



    13.  Open another command prompt and run ntdsutil
    14.  Type Domain Management or Partition Management
    15.  Type Connections
    16.  Type Connect to server <Servername>
    17.  Type Quit
    18.  Type List
    19.  Type Delete nc dc=domaindnszones;dc=<domainname>;dc=<domainname>
    20.  After you removed that, you will now be able to cleanup the metadata by going back to the
           other command prompt and re-run the remove selected domain command
    21.  Type Quit twice to get out of the utility.





No comments:

Post a Comment