| 1. |
Solve : Changing domain names on workstations via script.? |
|
Answer» Kudos to y'all out there!!! I just wanted to know if there is any script that would change the domain name of a workstation and of course join it afterwards. We don't WANT to go to each and every workstation and do the following: Is this a homework question? Is this your network? More details please. This is not a homework question. We're to do it here in our network. We bought a new server and would like to set it up from scratch. We'll make this new server a new PDC and of course a new domain here in our organization. Now all workstations are currently part of a domain. If this new server is all set-up, the task of going to each and every machine and right clicking on My Computer and changing the domain name from the current one to the new one we'd set-up and supplying the admin username and password to rebooting is gonna be an ardous job. So I hope that there is s script that would do all of this. Please help...Did you try what Sidewinder suggested?Kudos to y'all! After some serious searching, found what I needed on this http://www.microsoft.com/technet/archive/winntas/tips/winntmag/migrwork.mspx?mfr=true. It explains how we can move machine accounts to a new domain including the fact that user profiles must also migrate with it. It even includes the scripts required for this task. But there is one thing that bothers me... Code: [Select]ECHO OFF REM Identify the client OS. if "%OS%"=="Windows_NT" goto winntscr goto end :winntscr BEGIN CALLOUT A REM Remap network drives to use new user ID credentials. FOR %%I IN (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO %0\..\reg UPDATE HKCU\Network\%%I\UserName="NEWDOMAIN\%USERNAME%" END CALLOUT A REM Add the Migrate user to the local Administrators group. net localgroup administrators OLDDOMAIN\Migrate /add > NUL REM Set environment variables for later use. %0\..\regchg "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" MigrateUser REG_SZ %USERNAME% > NUL %0\..\regchg "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" MigrateProfile REG_SZ %USERPROFILE% > NUL BEGIN CALLOUT B REM Enable automatic logon for the Migrate account. %0\..\regchg "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" AutoAdminLogon REG_SZ "1" > NUL %0\..\regchg "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" DefaultUserName REG_SZ "Migrate" > NUL %0\..\regchg "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" DefaultDomainName REG_SZ "OLDDOMAIN" > NUL %0\..\regchg "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" DefaultPassword REG_SZ "password" > NUL END CALLOUT B REM Null the shell to lock down Migrate logon. %0\..\regchg "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" Shell REG_SZ "" > NUL BEGIN CALLOUT C REM Tell NT to remain connected via RAS after user logoff so that the scripts can CONTINUE to run via RAS. %0\..\regchg "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" KeepRasConnections REG_SZ "1" > NUL END CALLOUT C :end REM Log user off. %0\..\Logoff.exe ...you'll find that there is a command BEGIN CALLOUT A and END CALLOUT A. It doesn't work. It keeps saying BEGIN is an unknown command. I thought that maybe it's a label or something but it still deosn't work to no avail. I there something that I'm missing? Quote Kudos to y'all! After some serious searching, found what I needed on this http://www.microsoft.com/technet/archive/winntas/tips/winntmag/migrwork.mspx?mfr=true. It explains how we can move machine accounts to a new domain including the fact that user profiles must also migrate with it. It even includes the scripts required for this task. But there is one thing that bothers me... D'oh! Never mind this BEGIN CALLOUT thingy. I found out that this is something used in publications or whitepapers to indicate blocks of code. (Dang! They should've used comment lines/remarks!) Anyway, I got the script running except that I need the Resource Kit for it to work properly. For anyone who needs some script with regards to migrating workstations, just visit the link I supplied. |
|