Metadata cleanup (easy to follow instructions)

Below are my notes for how to perform a metadata cleanup. Also below is the actual output from a metadata cleanup for when I removed dc01-denver.test.com. 

# enter ntdsutil
c:\tmp>ntdsutil

# activate ntds
ntdsutil: activate instance ntds

# enter metadata cleanup
ntdsutil: Metadata cleanup

# enter connections
metadata cleanup: connections

# connect to local server 
server connections: connect to server dc01-newyork

# quit server connection
server connections: quit

# now that we're returned to mc, enter select target
metadata cleanup: select operation target

# lets get a list of our sites (note the site containing our bad DC)
select operation target: list sites
0 .
1 ..
2 ...

# set a selected site from the list site output (in our case 0)
select  operation target: select site 0

# lets get a list of our domains (note the domain containing our bad DC)
select operation target: list domains in site
0 .
1 ..
2 ...

# set a selected domain from the list domain output (in our case 0)
select  operation target: select domain 0

# lets get a list of our servers (note our bad DC)
select operation target: list servers in site
0 .
1 ..
2 ...

# set a selected server from the list server output (in our case 0)
select operation target: select server 0

# unless we want to only delete a specific naming context on this server simply quit
select operation target: quit

# now we remove our bad dc
metadata cleanup: remove selected server

# manually removed server rep link container in dssite
# manually removed misc rep links for bad dc in dssite


C:\Windows\system32>ntdsutil
ntdsutil: activate instance ntds
Active instance set to "ntds".
ntdsutil: metadata cleanup
metadata cleanup: connections
server connections: connect to server dc01-newyork
Binding to dc01-newyork ...
Connected to dc01-newyork using credentials of locally logged on user.
server connections: quit
metadata cleanup: select operation target
select operation target: list sites
Found 3 site(s)
0 - CN=NEWYORK,CN=Sites,CN=Configuration,DC=test,DC=com
1 - CN=DENVER,CN=Sites,CN=Configuration,DC=test,DC=com
2 - CN=MIAMI,CN=Sites,CN=Configuration,DC=test,DC=com
select operation target: select site 1
Site - CN=DENVER,CN=Sites,CN=Configuration,DC=test,DC=com
No current domain
No current server
No current Naming Context
select operation target: list domains in site
Found 1 domain(s)
0 - DC=test,DC=com
select operation target: select domain 0
Site - CN=DENVER,CN=Sites,CN=Configuration,DC=test,DC=com
Domain - DC=test,DC=com
No current server
No current Naming Context
select operation target: list servers in site
Found 2 server(s)
0 - CN=DC01-DENVER,CN=Servers,CN=DENVER,CN=Sites,CN=Configuration,DC=test,DC=com

1 - CN=DC02-DENVER,CN=Servers,CN=DENVER,CN=Sites,CN=Configuration,DC=test,DC=com

select operation target: select server 0
Site - CN=DENVER,CN=Sites,CN=Configuration,DC=test,DC=com
Domain - DC=test,DC=com
Server - CN=DC01-DENVER,CN=Servers,CN=DENVER,CN=Sites,CN=Configuration,DC=test,D
C=com
        DSA object - CN=NTDS Settings,CN=DC01-DENVER,CN=Servers,CN=DENVER,CN=Sit
es,CN=Configuration,DC=test,DC=com
        DNS host name - DC01-DENVER.test.com
        Computer object - CN=DC01-DENVER,OU=Domain Controllers,DC=test,DC=com
No current Naming Context
select operation target: quit
metadata cleanup: remove selected server
Transferring / Seizing FSMO roles off the selected server.
Removing FRS metadata for the selected server.
Searching for FRS members under "CN=DC01-DENVER,OU=Domain Controllers,DC=test,DC
=com".
Deleting subtree under "CN=DC01-DENVER,OU=Domain Controllers,DC=test,DC=com".
The attempt to remove the FRS settings on CN=DC01-DENVER,CN=Servers,CN=DENVER,CN
=Sites,CN=Configuration,DC=test,DC=com failed because "Element not found.";
metadata cleanup is continuing.
"CN=DC01-DENVER,CN=Servers,CN=DENVER,CN=Sites,CN=Configuration,DC=test,DC=com" r
emoved from server "dc01-newyork"
metadata cleanup: quit
ntdsutil: quit