Have a Question?
< All Topics

How to decommission AD Child Domain

Please refer to the following steps on how to decommission AD Child Domain

  • Root Domain = abc.com
  • Child Domain = child.abc.com
  • Domain Controller in Child Domain = child-dc01 & child-dc02
  • Users in child domain are using @child.com as their Email Address
  1. Disabled all Users’ Mailbox & Distribution Group from child domain in Exchange 2013 Server
#Define the DC running on Child Domain
$IGPT_DC = "child-dc01.child.abc.com"

#Disable Mailbox 
$Mailboxes = Get-Mailbox -DomainController $IGPT_DC   | ? PrimarySMTPAddress -Like "*@child.com" | Select Name, UserPrincipalName, Database

foreach ($Mailbox in $Mailboxes) {

   Disable-Mailbox -Identity $Mailbox.UserPrincipalName -DomainController $IGPT_DC -Confirm:$false


#Disable Distribution Group 
Get-DistributionGroup -DomainController $IGPT_DC | Disable-DistributionGroup -DomainController $IGPT_DC
  1. Run "netdom query fsmo"" on CHILD-DC01 to identify where is the PDC, RID pool manager and Infrastructure role
netdom query fsmo
    Schema master               DC01.abc.com
    Domain naming master        DC01.abc.com
    PDC                         CHILD-DC01.child.abc.com
    RID pool manager            CHILD-DC01.child.abc.com
    Infrastructure master       CHILD-DC01.child.abc.com
  1. Login to CHILD-DC02 and run "Test-ADDSDomainControllerUninstallation" to verify this DC can be demoted without any issue. Resolve the issue detected if any prior continue to step 4
#Test run to ensure that this DC can be demoted successfully
  1. Demote CHILD-DC02 with Uninstall-ADDSDomainController and server will reboot automatically once the operation is complete
#Demote DC 
LocalAdministratorPassword: ********
Confirm LocalAdministratorPassword: ********

The server will be automatically restarted when this operation is complete. The domain will no longer exist after you
uninstall Active Directory Domain Services from the last domain controller in the domain.
Do you want to continue with this operation?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
  1. Login to CHILD-DC01 which is the last DC in Child Domain, and run the following
#Verify there is no error 
Test-ADDSDomainControllerUninstallation -DemoteOperationMasterRole -LastDomainControllerInDomain -RemoveApplicationpartitions

#Decommission the last DC in Child Domain
Uninstall-ADDSDomainController -DemoteOperationMasterRole -LastDomainControllerInDomain -RemoveApplicationpartitions

The Child Domain was completed demoted and removed from Root Domain now.

Remove Exchange Mailbox Database

  1. Remove the Mailbox Database Copy in DAG Cluster from passive node and manually delete the LOG Folder & .edb file to free up disk space
Get-MailboxDatabaseCopyStatus * 

#Remove the mailbox database copy from the pasive node
Remove-MailboxDatabaseCopy -Identity IGPT\IB-MBX01  -Confirm:$False

WARNING: The copy of mailbox database "IGPT" on server "IB-MBX01" has been removed. 
If necessary, manually delete the database copy's files located at "L:\IGPT" and "M:\IGPT\IGPT.edb" on that server
  1. Remove the Mailbox Database from Active Node
#Remove the Mailbox Database from Active Node
Remove-MailboxDatabase -Identity IGPT 
Table of Contents
Scroll to Top