?
Solved

how to move workstation from DC to DC ?

Posted on 2015-01-19
4
Medium Priority
?
85 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 34

Assisted Solution

by:Paul MacDonald
Paul MacDonald earned 334 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 25

Assisted Solution

by:NVIT
NVIT earned 666 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 25

Accepted Solution

by:
NVIT earned 666 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This process allows computer passwords to be managed and secured without using LAPS. This is an improvement on an existing process, enhanced to store password encrypted, instead of clear-text files within SQL
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
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 …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

752 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