segunda-feira, abril 01, 2024

Steps to rename an Active Directory Domain

There are some requirements that I have not added to this article; you can find them in Microsoft articles.

 I will run the commands in a domain member machine, not in the domain controller. In the domain member server:

>Install-WindowsFeature RSAT-AD-Tools -IncludeAllSubFeature

 In the domain controller create a DNS zone for your new domain:

OLD Domain: contoso.com

New Domain: contosonew.com

 >Add-DnsServerPrimaryZone -Name contosonew.com -ReplicationScope "Domain" –PassThru

In the domain member-run:

>rendom /list 


A Domainlist.xml will be created. You need to edit the file and replace the DNSname and NetBiosName

<?xml version ="1.0"?>
<Forest>
    <Domain>
        <!-- PartitionType:Application -->
        <Guid>891277a0-70de-4f9d-a176-80140ea9c334</Guid>
        <DNSname>ForestDnsZones.contosonew.com</DNSname>
        <NetBiosName></NetBiosName>
        <DcName></DcName>
    </Domain>
    <Domain>
        <!-- PartitionType:Application -->
        <Guid>e60931a4-f3e9-4b7c-8ae2-1e4d2078338c</Guid>
        <DNSname>DomainDnsZones.contosonew.com</DNSname>
        <NetBiosName></NetBiosName>
        <DcName></DcName>
    </Domain>
    <Domain>
        <!-- ForestRoot -->
        <Guid>e070ac56-99c0-4005-8193-40535c6eabd1</Guid>
        <DNSname>contosonew.com</DNSname>
        <NetBiosName>CONTOSO</NetBiosName>
        <DcName></DcName>
    </Domain>
</Forest>

>rendom /showforest

Upload the file:

>rendom /upload

Prepare:

>rendom /prepare

Execute, Domain Controllers will be restarted automatically
>rendom /execute

 

 Fix the GPO issues in the domain controller:

gpfixup /olddns:contoso.com /newdns:contosonew.com


gpfixup /oldnb:TEST /newnb:RESOURCE

Rename the Domain Controllers:

netdom computername DC1.contoso.com /add:DC1.contosonew.com
netdom computername DC1.contosonew.com /makeprimary:DC1.contosonew.com

Remove the old reference to the old domain

rendom /clean

Finish the process (For me I got several error, and after a few minutes and was able to finish the process):

rendom /end