DaveHope.co.uk

Removing a child domain that no longer exists

I was asked to remove a child domain at work today. Usually that wouldn’t be a problem but unfortunately the final DC had been wiped and not been dcpromo’d (Cleanly removed from the domain).

So I thought I’d document the process should anyone else find themselves in a similar situation. To do most of the below, you’ll need to be an Enterprise Admin.

  1. Remove all the DNS entries for the missing DCs and the child domain. Make sure you get the GUID entries too.
  2. Fire up ntdsutil and follow the below steps. When you select a server to connect to, connect to the operation master.
    ntdsutil: metadata cleanup
    metadata cleanup:
    metadata cleanup: connections
    server connections:
    server connections: connect to server london.nwtraders.msft
    Binding to london ...
    Connected to london using credentials of locally logged on user
    server connections:
    server connections: quit
    metadata cleanup:
    metadata cleanup: select operation target
    select operation target:
    select operation target: list domains
    Found 2 domain(s)
    0 - DC=nwtraders,DC=msft
    1 - DC=child,DC=nwtraders,DC=msft
    select operation target:
    select operation target: select domain 1
    No current site
    Domain - DC=child,DC=nwtraders,DC=msft
    No current server
    No current Naming Context
    select operation target:
    select operation target: quit
    metadata cleanup:
    metadata cleanup: remove selected domain

    Depending on the exact situation, you may get an error about needing to remove a server first (Sorry, I can’t recall the exact error). If you do, there’s an extra step you need to undertake first.

    ntdsutil: metadata cleanup
    metadata cleanup:
    metadata cleanup: connections
    server connections:
    server connections: connect to server london.nwtraders.msft
    Binding to london ...
    Connected to london using credentials of locally logged on user
    server connections:
    server connections: quit
    metadata cleanup:
    metadata cleanup: select operation target
    select operation target:
    select operation target: list sites
    Found 1 site(s)
    0 - CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=nwtraders,DC=msft
    select operation target:
    select operation target: select site
    Site - CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=nwtraders,DC=msft
    No current domain
    No current server
    No current Naming Context
    select operation target:
    select operation target: list servers in site
    Found 1 server(s)
    0 - CN=brisbane,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=nwtraders,DC=msft
    select operation target: select server 0

    Then repeat the first process to remove the server (remove selected server).

  3. Open up Active Directory Sites And Services and remove any stranded servers.

Comments

Leave a Reply