Solved

how to move workstation from DC to DC ?

Posted on 2015-01-19
4
73 Views
Last Modified: 2015-02-10
Our Domain "abc.com" contains about 50 workstations managed by windows Server 2003 DC, with DNS and dhcp Services. For several reasons, we preferred to prepare new server and build a new domain.
we start from scratch! with new domain name( xyz.com) with new IP address and new DNS,DHCP.

the Question is :
How i can move the pc's from abc.com to xyz.com With minimal effort ?
 
I'm thinking about scripting .bat file to directe the machine from the old domain and join it to a new domain, or any similar action.

thank u
0
Comment
Question by:Dhafer Algarni
  • 2
4 Comments
 
LVL 33

Assisted Solution

by:paulmacd
paulmacd earned 167 total points
ID: 40558318
Remove the computers from the old domain, then join them to the new one.

You might be able to script the removal, but I don't know about the re-joining.
0
 
LVL 23

Assisted Solution

by:NVIT
NVIT earned 333 total points
ID: 40558334
Unjoin from domain:
netdom /Domain:abc.com member georgepc /delete

Join domain:
netdom /domain:xyz.com /user:domainadminname /password:nottelling member georgepc  /joindomain

Here is a .bat method based on above.
IMPORTANT: It has not been tested. Be sure to test on 1 station before doing on all stations:

REM Do this one time.
REM Make text file stns.txt of stn names. stns.txt is used by UnJoinDom.bat and JoinDom.bat
NET VIEW > stns.txt

REM IMPORTANT: Before running UnJoinDom.bat, remove any stns from stns.txt 
REM you don't want to affect, e.g. domain controllers, other servers

Open in new window

UnJoinDom.bat
REM UnJoinDom.bat
REM Run UnJoinDom.bat as domain admin:

REM IMPORTANT: Before running UnJoinDom.bat, remove any stns from stns.txt 
REM you don't want to affect, e.g. domain controllers, other servers

REM IMPORTANT: ECHO prefix is used to confirm that it should work. 
REM 	Remove ECHO prefix to run for real.
set OldDom=abc.com
for /f "skip=3 tokens=1-2 delims=\ " %%a in (stns.txt) do (
	if %%a=The goto :eof
	ECHO netdom /Domain:%OldDom% member %%a /delete
	echo Please reboot stn %%a
	echo After logon, run JoinDom.bat
)

Open in new window

JoinDom.bat
REM JoinDom.bat
REM Run JoinDom.bat from each stn after unjoining and rebooting stn.
REM IMPORTANT: ECHO prefix is used to confirm that it should work. 
REM 	Remove ECHO prefix to run for real.
set NewDom=xyz.com
for /f "skip=3 tokens=1-2 delims=\ " %%a in (stns.txt) do (
	if /i %%a=%computername% ECHO netdom /domain:%NewDom% /user:domainadminname /password:nottelling member %%a /joindomain
)

Open in new window

0
 

Author Comment

by:Dhafer Algarni
ID: 40565610
NewVillageIT thank u for reply ,,

But can explain what the meaning of "stns" and whats the content of "stns.txt "
or its just kind of command used in batch file

ssory , i'm not competent in scripting :(
0
 
LVL 23

Accepted Solution

by:
NVIT earned 333 total points
ID: 40565665
Hi Dhafer...

NET VIEW sends its output to the file stns.txt, which has the names of the workstations.

If you open a CMD prompt, you can type each line (mostly) and see the effect.

However, be careful when you reach the NETDOM command as it will unjoin the workstation from the domain. Of course, if you are in a test lab, this is fine.

For testing reasons, you can test 1 station to gain confidence. In stns.txt, add the name of the test station. For example, if you have a station named Station01, in stns.txt, put these 4 lines:
1
2
3
\\station01

Open in new window

Save the file.
Create the other files UnJoinDom.bat and JoinDom.bat. To copy the code, pick the Select All link. Then press Ctrl-C to copy. In your text editor, press Ctrl-V to paste.

A simple location is to put all 3 files in a central location, e.g. on a USB thumb drive. This way, you can connect it to each station that will unjoin and join the domain.

Let's do a test. It can be on any station. You don't have to logon as domain admin at this point. We just want to see what the command looks like.

Open a CMD prompt.

I'll assume you have a thumb drive on drive e:\. Change the letter as you need.

Type:
e:\UnJoinDom.bat

Open in new window


If that works correctly, you will see the NETDOM command echoed to the prompt. Specifically:
netdom /Domain:abc.com member station01 /delete
Please reboot stn station01 
After logon, run JoinDom.bat

Open in new window


Type:
e:\JoinDom.bat

Open in new window


If that works correctly, you will see the NETDOM command echoed to the prompt. Specifically:
netdom /domain:xyz.com /user:domainadminname /password:nottelling member station01 /joindomain

Open in new window


Are you on a deadline? As an alternative, also consider 3rd party programs. If you decide to go that route, just message me and I'll give a recommendation.
0

Featured Post

Integrate social media with email signatures

Is your company active on social media? Do you also use email signatures? Including social media icons in your email signature is a great way to get fans for free. Let all your email users know you’re on social media quickly and easily, in a single click.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ADFS 3.0 and UPN Problem 6 15
Question on security Audit 2 49
active directory 3 22
Active Directory Problem 4 24
We recently endured a series of broadcast storms that caused our ISP to shut us down for brief periods of time. After going through a multitude of tests, we determined that the issue was related to Intel NIC drivers on some new HP desktop computers …
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now