:::: MENU ::::

Removing Orphaned Domains from Active Directory

1) Determine the domain controller that holds the Domain Flexible Single Master Operations (FSMO) role. To identify the server holding this role:
1.1) Start the Active Directory Domains and Trusts Microsoft Management Console (MMC) snap-in from the Administrative Tools menu.
1.2) Right-click the root node in the left pane titled Active Directory Domains and Trusts, and then click Operations Master.
1.3) 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.
2) Verify that all servers for the domain have been demoted.
3) Open 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.

* IF it gives the error: „DsRemoveDsDomainW error 0x2162(The requested domain could not be deleted because there exist domain controllers that still host this domain.”

THEN do the following first:
1) open mmc
2) go to add / remove snap-in and select ADSI-Edit & click ok
3) Right Click on ADSI-Edit and select "Configuration" under select a well known Naming Context. Click ok to exit
4) Under CN=Sites delete the child domain controllers from the respective site(s)

** IF you get this error „DsRemoveDsDomainW error 0x2015(The directory service can perform the requested operation only on a leaf object”

Use the following steps to get rid of the error:

1) From Command Prompt type ntdsutil, and then press ENTER.
2) Type partition management, and then press ENTER.
3) Type connections, and then press ENTER.
4) Type connect to server Domain_Controller_Name, and then press ENTER.
After the following message appears,"Connected to Domain_Controller_Name using credentials of locally logged on user" type quit, and then press ENTER:
5) At the domain management prompt, type list, and then press ENTER.
6) Type the following command, and then press ENTER.
delete nc dc=domaindnszones,dc=Child_Domain,dc=extension
Note In this command, Child_Domain represents the name of the child domain that you want to remove.
For example, if the child domain is let.do.com, type the following command, and then press ENTER:
delete nc DC=DomainDnsZones,DC=let,DC=do,DC=com
Quit Ntdsutil.

Once this is removed, then you can again remove the child domain using ntdsutil from the top.


1 Komentarz

  • Odpowiedz Juan Granados |

    Thank you very much for this article. I got the error „The directory service can perform the requested operation only on a leaf object” and your workaround worked perfectly.

Co o tym sądzisz ?