Saturday, January 16, 2010

Change Default Domain Name (Log on to) from an Input File – Script

This batch file can be used to change the default domain name (Log on to).  This script is useful when performing computer migrations.  The input for this script is a text file which contains all computer names. 


If you change the DefaultDomainName and AltDefaultDomainName values, the Log on to filed will populate with this new value.  But I have seen many failed instances.   The workaround for this issue is to populate the CachePrimaryDomain registry string with your new Domain name. 


Usage: Create a text file called computers.txt with all your computer names and update the KERALA domain name in the script with your domain name.

Download: You can download the script from this location


Hey Santosh-
Thanks for taking the the time to share and help out fellow IT professionals.
This looks to be very simple and easy to follow.
I have always found "migrating comp account" to be really a somewhat avoided subject. But you addressed it!
Thanks and I will give this a try.
Shah Murad

Thanks for the feedback!

This comment has been removed by the author.


I just run the command but didn't change the WinXP to new Domain?


Please post your input file and script here.

>>> From where do i run this Bat file? Source domain or target domain dc?

Doesn’t really matter. You can run it from source or target as long as you can access the PCs and both domains. Since you are migrating from Source to Target, I would say run it from the target side.

can this be added via Group Policy?

Sure. You can update a registry setting using GPO. But in this particular scenario, we need to update the registry right after the migration. Domain membership is changing from Source Domain to Target Domain.

Does this work for xp, vista & win7? Thanks Santhosh your guidance has helped a lot.

Post a Comment

Popular Posts


Twitter Delicious Facebook Digg Stumbleupon Favorites More