Clean Up Server Metadata using cmd

You can clean up metadata by using Ntdsutil.exe, a command-line tool that is installed automatically on all domain controllers and servers that have Active Directory Lightweight Directory Services (AD LDS) installed. Ntdsutil.exe is also available on computers that have RSAT installed. To clean up server metadata by using Ntdsutil

Value Description
ntdsutil: metadata cleanup Initiates removal of objects that refer to a decommissioned domain controller.
remove selected server Removes objects for a specified, decommissioned domain controller from a specified server.
<ServerName> or <ServerName1> The distinguished name of the domain controller whose metadata you want to remove, in the form cn=ServerName,cn=Servers,cn=SiteName, cn=Sites,cn=Configuration,dc=ForestRootDomain. If you specify only one server name, the objects are removed from the current domain controller.
on <ServerName2> Specifies removing server metadata on <ServerName2>, the Domain Name System (DNS) name of the domain controller to which you want to connect. If you have identified replication partners in preparation for this procedure, specify a domain controller that is a replication partner of the removed domain controller.