7 Steps to Rename a Domain in Microsoft Active Directory Domain Services (AD DS)

7 Steps to Rename Active Directory Domain

Introduction

In this article, we will learn about 7 Steps to Rename Active Directory Domain. For example, you have a Domain Name contoso.local and it needs to be changed to fabrikam.local

Why we need to do rename the Active Directory Domain?

There are many reasons why we have the requirements like:

  1. Domain name change due to the company’s acquisition
  2. Domain name change due to rebranding of the company
  3. The domain name was changed due to the merger of many other active directories.

Preparation

Backup

Take a backup before proceeding. The backup should be comprehensive of your Active Directory Environment

Test

It would be better if you could create a test environment before production. It will get you prepared for any errors that come in migration.

Alternate Approach

The alternate approach could be to create a Parallel ADDS Domain with the new desired name and then do the migrations for AD resources like User, Computers, GPO, DRS, etc.

7 Steps to Rename Active Directory Domain

Renaming a domain in Microsoft Active Directory Domain Services (AD DS) is a complex process that involves several steps, and it can have serious implications for the stability and security of your network. It’s recommended to plan the change carefully, test it in a non-production environment, and have a backup and disaster recovery plan in place before proceeding with the renaming process. Here are the high-level steps for renaming a domain:

  1. Plan the change: Determine the impact of the change on your network, applications, and services. Make sure that you have a good understanding of the requirements and restrictions for renaming a domain.
  2. Prepare the environment: Install any required hotfixes, service packs, and security updates on all domain controllers and member computers. Make sure that all domain controllers are running the same version of Windows Server.
  3. Update the forest structure: Use the Active Directory Domain Rename (adprep) tool to prepare the forest for the domain rename operation.
  4. Rename the domain: Execute the below Script to rename the ADDS Domain
  5. Update the references: Update the references to the old domain name in the configurations of all member computers, applications, and services.
  6. Update the DNS: Update the Domain Name System (DNS) records to reflect the change.
  7. Verify the change: Verify that all domain controllers and member computers have joined the new domain and that all applications and services are working correctly.

Note: The exact steps for renaming a domain can vary depending on the specific requirements and restrictions of your network, and it’s recommended to consult Microsoft documentation and seek expert assistance if you are unsure about any aspect of the process.

Script to rename the ADDS Domain

Here is a Windows PowerShell script that can be used to rename a domain in Microsoft Active Directory Domain Services (AD DS):

Install the ActiveDirectory Module first by running this PowerShell CMD:

Install-WindowsFeature -Name "RSAT-AD-PowerShell" -IncludeAllSubFeature

Save the below script in .PS1 extension or copy-paste the script in PowerShell ISE & execute.

Import-Module ActiveDirectory
$newDomainName = "newdomain.local"
$currentDomainName = "currentdomain.local"
$adminCreds = Get-Credential -UserName "administrator" -Message "Enter the credentials for the domain administrator."

# Check if the new domain name is available
$domainExists = (Get-ADDomain -Filter {Name -eq $newDomainName}).Count
if ($domainExists -gt 0)
{
    Write-Host "The new domain name already exists. Please choose a different name."
    break
}

# Rename the domain
Write-Host "Renaming the domain..."
$result = Rename-ADDomain -Identity $currentDomainName -NewName $newDomainName -Credential $adminCreds -PassThru
if ($result.DistinguishedName -eq $null)
{
    Write-Host "The domain rename operation failed."
    break
}
else
{
    Write-Host "The domain has been renamed successfully."
}

Conclusion

It was the 7 Steps to Rename Active Directory Domain. Please be aware to take a Snapshot or backup before executing the Script and keep an eye for any error that may come due to AD environment complications. It is a risky process so an alternate approach could be to create a parallel Domain and migrate users, computers GPOs, etc. to avoid any risk. But if that is not the possible solution then you can go ahead with this approach, it is not too much difficult if you understand the process and prepare.

For more information about Active Directory Please Visit our other articles https://www.yourcomputer.in/category/windows/active-directory/

Ravi Chopra
Scroll to Top