# Using NTDSUTIL Metada Cleanup to Remove a Failed/Offline Domain Controller Object.

[https://chinnychukwudozie.com/2014/01/27/using-ntdsutil-metada-cleanup-to-remove-a-failedoffline-domain-controller-object/](https://chinnychukwudozie.com/2014/01/27/using-ntdsutil-metada-cleanup-to-remove-a-failedoffline-domain-controller-object/)

In this post, I would like to talk about using the ntdsutil utility for metadata cleanup. A domain controller failure ‘DC00’ recently occurred in my lab. Running the `repadmin /replsum` command confirmed a replication error and showed DC00 as unavailable:

[![metadatacleanup04repadminerror](https://chinnychukwudozie.files.wordpress.com/2013/12/metadatacleanup04repadminerror.png?w=300&h=131)](https://chinnychukwudozie.files.wordpress.com/2013/12/metadatacleanup04repadminerror.png)

Since a dcpromo was obviously out of the question, I used the Ntdsutil metadata cleanup command to effect the removal in the following steps.

Start the Ntdsutil Tool:

Open a command prompt as an administrator. At the prompt, type ntdsutil and press enter. This put me directly in the ntdsutil mode. Entering ‘help’ shows all the options directly available :

[![ntdshelp](https://chinnychukwudozie.files.wordpress.com/2013/12/ntdshelp.png?w=300&h=203)](https://chinnychukwudozie.files.wordpress.com/2013/12/ntdshelp.png)

At the Ntdsutil prompt, select and type `metadata cleanup` command and press enter.

At the metadata cleanup prompt, type `connections` and press enter.

At the server connections prompt, type `connect to server ws2012r2 `and press enter. Where ws2012r2 is a domain controller dns name.

After connecting to the domain controller, type quit at the server connections prompt to exit out to the `metadata cleanup` prompt.

Now at the `metadata cleanup `prompt, type `select operation target `and press enter. Entering this mode, will enable me select the sites, domains and servers I intend to work with.

[![metadatacleanup02](https://chinnychukwudozie.files.wordpress.com/2013/12/metadatacleanup02.png?w=300&h=253)](https://chinnychukwudozie.files.wordpress.com/2013/12/metadatacleanup02.png)

[![ntdsselect](https://chinnychukwudozie.files.wordpress.com/2013/12/ntdsselect.png?w=300&h=99)](https://chinnychukwudozie.files.wordpress.com/2013/12/ntdsselect.png)

From the help options available at `select operation target`, select, and type `list domains`. Press enter.

At the `select operation target` type `select domain 0`. Where domain 0 is the intended domain.

At the next `select operation target` prompt, type list sites and press enter.

At the next `select operation target` prompt, type `select site 0` and press enter.

At the next `select operation target` prompt, type `list servers in site` and press enter.

At the next `select operation target` prompt, type `select server 1` where server 1 is the offline domain controller object I intend to remove. Press enter.

At the next `select operation target` prompt, type `quit` to exit out to the `metadata cleanup` prompt.

At the next `metadata cleanup` prompt, type `Remove selected server`.

[![metadatacleanup03](https://chinnychukwudozie.files.wordpress.com/2013/12/metadatacleanup03.png?w=300&h=255)](https://chinnychukwudozie.files.wordpress.com/2013/12/metadatacleanup03.png)

[![metadatacleanup01](https://chinnychukwudozie.files.wordpress.com/2013/12/metadatacleanup01.png?w=300&h=80)](https://chinnychukwudozie.files.wordpress.com/2013/12/metadatacleanup01.png)

[![metadatadialog](https://chinnychukwudozie.files.wordpress.com/2013/12/metadatadialog.png?w=300&h=152)](https://chinnychukwudozie.files.wordpress.com/2013/12/metadatadialog.png)

At the ‘Server Remove Confirmation Dialog’, click yes to remove the failed Domain Controller server object.After the removal is successful, I exit out of the `ntdsutil` tool by typing `quit` all the way up. I ran the `repadmin /replsummary` command again to verify and the result shows no replication errors.

[![metadatacleanup05repadminnoerrors](https://chinnychukwudozie.files.wordpress.com/2013/12/metadatacleanup05repadminnoerrors.png?w=300&h=90)](https://chinnychukwudozie.files.wordpress.com/2013/12/metadatacleanup05repadminnoerrors.png)

I still had to go into the DNS forward lookup and reverse lookup zones to manually remove references to the offline domain controller object.I hope this helps.