How To Remove Data in Active Directory After An Unsuccessful Domain Controller Demotion
How To Remove Data in Active Directory After An Unsuccessful Domain Controller Demotion
On This Page
• SUMMARY
o Windows Server 2003 Service Pack 1 (SP1) or
later service packs – Enhanced version of Ntdsutil.exe
o Procedure 1: Windows Server 2003 SP1 or later
service packs only
o Procedure 2: Windows 2000 (All versions)
Windows Server 2003 RTM
Advanced optional syntax with the SP1 or
later versions of Ntdsutil.exe
• MORE INFORMATION
o Determine the DN of the server
• REFERENCES
SUMMARY
This article describes how to remove data in Active
Directory after an unsuccess...
This article describes how to remove data in Active Directory after an unsuccessful domain
controller demotion.
Warning If you use the ADSI Edit snap-in, the LDP utility, or any other LDAP version 3 client,
and you incorrectly modify the attributes of Active Directory objects, you can cause serious
problems. These problems may require you to reinstall Microsoft Windows 2000 Server,
Microsoft Windows Server 2003, Microsoft Exchange 2000 Server, Microsoft Exchange Server
2003, or both Windows and Exchange. Microsoft cannot guarantee that problems that occur if
you incorrectly modify Active Directory object attributes can be solved. Modify these attributes
at your own risk.
The Active Directory Installation Wizard (Dcpromo.exe) is used for promoting a server to a
domain controller and for demoting a domain controller to a member server (or to a stand-alone
server in a workgroup if the domain controller is the last in the domain). As part of the demotion
process, the wizard removes the configuration data for the domain controller from Active
Directory. This data takes the form of an NTDS Settings object that exists as a child of the server
object in Active Directory Sites and Services.
If the NTDS Settings object is removed incorrectly (for example, if the NTDS Settings object is
removed incorrectly from a demotion attempt), the administrator can manually remove the
metadata for a server object. In Windows Server 2008, and Windows Server 2008 R2, the
administrator can remove the metadata for a server object by removing the server object in the
Active Directory Users and Computers snap-in.
In Windows Server 2003 and Windows 2000 Server, the administrator can use the Ntdsutil.exe
utility to manually remove the NTDS Settings object. The following steps list the procedure for
removing the NTDS Settings object in Active Directory for a particular domain controller. At
each Ntdsutil menu, the administrator can type help for more information about the available
options.
Back to the top
Windows Server 2003 Service Pack 1 (SP1) or later service packs – Enhanced
version of Ntdsutil.exe
The version of Ntdsutil.exe that is included with Service Pack 1 or later service packs for
Windows Server 2003 has been enhanced to make the metadata cleanup process complete. The
Ntdsutil.exe version that is included with SP1 or later service packs does the following when
metadata cleanup is run:
Caution The administrator must also make sure that replication has occurred since the demotion
before manually removing the NTDS Settings object for any server. Using the Ntdsutil utility
incorrectly may result in partial or complete loss of Active Directory functionality.
Back to the top
Note If you try to connect to the same server that you want to
delete, when you try to delete the server that step 15 refers to,
you may receive the following error message:
Note You may also see this error when you try to bind to the
domain controller that will be removed. Ntdsutil has to bind
to a domain controller other than the one that will be
removed with metadata cleanup.
16. Type quit, and then press ENTER at each menu quit
the Ntdsutil utility. You should receive confirmation that the
connection disconnected successfully.
17. Remove the cname record in the _msdcs.root
domain of forest zone in DNS. Assuming that DC will be
reinstalled and re-promoted, a new NTDS Settings object is
created with a new GUID and a matching cname record in
DNS. You do not want the DCs that exist to use the old
cname record.
As best practice, you should delete the host name and other
DNS records. If the lease time that remains on Dynamic Host
Configuration Protocol (DHCP) address assigned to offline
server is exceeded then another client can obtain the IP
address of the problem DC.
18. In the DNS console, use the DNS MMC to delete
the A record in DNS. The A record is also known as the Host
record. To delete the A record, right-click the A record, and
then click Delete. Also, delete the cname record in the
_msdcs container. To do this, expand the _msdcs container,
right-click cname, and then click Delete.
CN=Topology,CN=Domain System
Volume,CN=DFSR-
Globalsettings,CN=System,DC=Your
Domain,DC=Domain Suffix
Note If you try to connect to the same server that you want to
delete, when you try to delete the server that step 15 refers to,
you may receive the following error message:
Note You may also see this error when you try to bind to the
domain controller that will be removed. Ntdsutil has to bind
to a domain controller other than the one that will be
removed with metadata cleanup.
Now that the NTDS Settings object has been deleted, you can delete the computer account, the
FRS member object, the cname (or Alias) record in the _msdcs container, the A (or Host) record
in DNS, the trustDomain object for a deleted child domain, and the domain controller.
Note You do not need to manually remove the FRS member object in Windows Server 2003
RTM because the Ntdsutil.exe utility has already removed the FRS member object when you run
the utility. Additionaly, the metadata of the computer account cannot be removed if the computer
account of the DC contains another leaf object. For example, Remote Installation Services (RIS)
might be installed on the DC.
The Adsiedit utility is included with the Windows Support Tools feature in both Windows 2000
Server and Windows Server 2003. To install the Windows Support Tools, following these steps:
Windows Server 2003 SP1 introduced a new syntax that can be used. By using the new
syntax, it is no longer required to bind to the DS and select your operation target. To use the new
syntax, you must know or obtain the DN of the NTDS settings object of the server that is being
demoted. To use the new syntax for metadata cleanup, follow these steps:
1. Run ntdsutil.
2. Switch to the metadata cleanup prompt.
3. Run the following command
As best practice, you should delete the host name and other
DNS records. If the lease time that remains on Dynamic Host
Configuration Protocol (DHCP) address assigned to offline
server is exceeded, another client can obtain the IP address of
the problem DC.
5. If the deleted computer was the last domain
controller in a child domain, and the child domain was also
deleted, use ADSIEdit to delete the trustDomain object for
the child. To do this, follow these steps:
MORE INFORMATION
For more information about how to forcefully demote a
Windows Server 2003 or Wi...
For more information about how to forcefully demote a Windows Server 2003 or Windows
2000 domain controller, click the following article number to view the article in the Microsoft
Knowledge Base:
332199 (http://support.microsoft.com/kb/332199/ ) Domain controllers do not demote gracefully
when you use the Active Directory Installation Wizard to force demotion in Windows Server
2003 and in Windows 2000 Server
There are several ways to obtain the DN of the server object that is to be removed. The
following example uses Ldp.exe. To obtain the DN by using Ldp.exe, follow these steps:
1. Run LDP.
2. Bind to rootDSE.
3. Select View\tree. Base DN should be
cn=configuration,dc=rootdomain,dc=<suffix>.
4. Expand Sites.
5. Expand the site where the server object resides.
6. Expand Servers.
7. Expand the server that you are removing.
8. Look for a line on the right hand side that starts
with DN.
9. Copy whole line excluding the DN.
REFERENCES
For more information about how to use a script to remove
Active Directory metada...
For more information about how to use a script to remove Active Directory metadata for a
domain controller, visit the following Microsoft TechNet Web site:
http://www.microsoft.com/technet/scriptcenter/scripts/ad/domains/addmvb04.mspx
(http://www.microsoft.com/technet/scriptcenter/scripts/ad/domains/addmvb04.mspx)
For more information about how to use the Graphical User Interface (GUI) to perform metadata
cleanup in Windows Server 2008 and later, visit the following Microsoft TechNet Web Site:
http://technet.microsoft.com/en-us/library/cc816907(WS.10).aspx#bkmk_graphical
(http://technet.microsoft.com/en-us/library/cc816907(WS.10).aspx#bkmk_graphical)