Typically, when the last domain controller for a domain is demoted, the administrator selects the This server is the last domain controller in the domain option in the DCPromo tool, which removes the domain meta-data from Active Directory. This article describes how to remove domain meta-data from Active Directory if this procedure is not used or if or all domain controllers are taken offline but not demoted first. CAUTION: The administrator must verify that replication has occurred since the demotion of the last domain controller before manually removing the domain meta-data. Using the NTDSUTIL tool improperly can result in partial or complete loss of Active Directory functionality.
Removing Orphaned Domains from Active Directory
- Determine the domain controller that holds the Domain Naming Master Flexible Single Master Operations (FSMO) role. To identify the server holding this role:
- Start the Active Directory Domains and Trusts Microsoft Management Console (MMC) snap-in from the Administrative Tools menu.
- Right-click the root node in the left pane titled Active Directory Domains and Trusts, and then click Operations Master.
- The domain controller that currently holds this role is identified in the Current Operations Master frame.NOTE: If this changed recently, not all computer may have received this change yet due to replication.For more information about FSMO roles, click the following article number to view the article in the Microsoft Knowledge Base:
197132 (http://support.microsoft.com/kb/197132/ ) Windows 2000 Active Directory FSMO Roles
- Verify that all servers for the domain have been demoted.
- Click Start, point to Programs, point to Accessories, and then click Command Prompt.
- At the command prompt, type: ntdsutil.
- Type: metadata cleanup, and then press ENTER.
- Type: connections, and then press ENTER. This menu is used to connect to the specific server on which the changes will occur. If the currently logged-on user is not a member of the Enterprise Admins group, alternate credentials can be supplied by specifying the credentials to use before making the connection. To do so, type: set creds domainname username password , and then press ENTER. For a null password, type: null for the password parameter.
- Type: connect to server servername (where servername is the name of the domain controller holding the Domain Naming Master FSMO Role), and then press ENTER. You should receive confirmation that the connection is successfully established. If an error occurs, verify that the domain controller being used in the connection is available and that the credentials you supplied have administrative permissions on the server.
- Type: quit, and then press ENTER. The Metadata Cleanup menu is displayed.
- Type: select operation target, and then press ENTER.
- Type: list domains, and then press ENTER. A list of domains in the forest is displayed, each with an associated number.
- Type: select domain number, and then press ENTER, where number is the number associated with the domain to be removed.
- Type: quit, and then press ENTER. The Metadata Cleanup menu is displayed.
- Type: remove selected domain, and then press ENTER. You should receive confirmation that the removal was successful. If an error occurs, please refer to the Microsoft Knowledge Base for articles on specific error messages.
- Type: quit at each menu to quit the NTDSUTIL tool. You should receive confirmation that the connection disconnected successfully.
Domain controllers do not demote gracefully when you use the Active Directory Installation Wizard to force demotion in Windows Server 2003
Windows Server 2003 domain controllers
- By default, Windows Server 2003 domain controllers support forced demotion. Click Start, click Run, and then type the following command:
dcpromo /forceremoval
- Click OK.
- At the Welcome to the Active Directory Installation Wizard page, click Next.
- At the Force the Removal of Active Directory page, click Next.
- In Administrator Password, type the password and confirmed password that you want to assign to the Administrator account of the local SAM database, and then click Next.
- In Summary, click Next.
- Perform a metadata cleanup for the demoted domain controller on a surviving domain controller in the forest.
If you removed a domain from the forest by using the remove selected domain command in Ntdsutil, verify that all the domain controllers and the global catalog servers in the forest have removed all the objects and the references to the domain that you just removed before you promote a new domain into the same forest with the same domain name. Windows 2000 Service Pack 3 (SP3) and earlier global catalog servers are noticeably slower to remove objects and naming contexts than Windows Server 2003 is.
If resource access control entries (ACEs) on the computer that you removed Active Directory from were based on domain local groups, these permissions may have to be reconfigured, because these groups will not be available to member or stand-alone servers. If you plan to install Active Directory on the computer to make it a domain controller in the original domain, you do not have to configure access control lists (ACLs) any more. If you prefer to leave the computer as a member or stand-alone server, any permissions that are based on domain local groups must be translated or replaced. For more information about how permissions are affected after you remove Active Directory from a domain controller, click the following article number to view the article in the Microsoft Knowledge Base:
If the domain controller cannot start in normal mode
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
Important Follow these steps only as a last resort if the domain controller cannot start in normal mode.
To remove Active Directory from a domain controller, follow these steps:
- Restart the computer, and then press F8 to display the Windows 2000 Advanced Options menu.
- Choose Directory Services Restore Mode, press ENTER, and then press ENTER again to continue restarting.
- Modify the ProductType entry in the registry. To do this, follow these steps:
- Click Start, click Run, type regedit, and then click OK.
- Locate the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions
- In the right-pane, double-click ProductType.
- Type ServerNT in the Value data box, and then click OK.Note If this value is not set correctly or is misspelled, you may receive the following error message:
System Process – License Violation: The system has detected tampering with your registered product type. This is a violation of your software license. Tampering with product type is not permitted.
- Quit Registry Editor.
- Restart the computer.
- Log on with the administrator account and password that is used for Directory Service Repair mode.The computer will behave as a member server. However, there are still some remaining files and registry entries on the computer that are associated with the domain controller.
- Start Registry Editor and locate the following registry entry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters
If there is an entry for Src Root Domain Srv, right-click the value and then click Delete. This value must be deleted so that the domain controller sees itself as the only domain controller in the domain after promotion.
Important The above step is critical. Without it the re-promotion into the temporary AD forest will not complete and you will not be able to log on to the domain controller.
- Remove the remaining files and registry entries. To do this, follow these steps:
- Start the Active Directory Installation Wizard.
- Install Active Directory to make the computer a domain controller for a new, temporary domain, such as “psstemp.deleteme.”Note Make sure that you make the computer a domain controller in a different forest.
- After you install Active Directory, start the Active Directory Installation Wizard again, and then remove Active Directory from the domain controller.
- After you remove Active Directory from a domain controller, remove metadata that is left in the domain. For more information about how to remove this metadata, click the following article number to view the article in the Microsoft Knowledge Base:
216498 (http://support.microsoft.com/kb/216498/ ) How to remove data in Active Directory after an unsuccessful domain controller demotion






















