Copy Users Data from one computer to another

I have the senario below and would like any assistance.

- I have 40 users moving from one workstation to another.
- I have a list of their old and new computer name.
- I logon as the users already on the new 40 workstations to create the local profiles.

I would like a simple script to copy the user's profile like Document, Favorites, Desktop from their old workstation to the new ones.
Perhaps create two text files of the user name with old computer and new computer. The script will read the old computer text file first as IF userA, copy the data from OLD computer1, go to text file for new computer, and compare IF  UserA restore the file to the NEW Computer1.

These are my thoughts, but do not know how to write into a script or any advise would greatly appreciated.

UserA     OLD COMPUTER1
UserB     OLD COMPUTER2

UserA     NEW COMPUTER1
UserB     NEW COMPUTER2
kyleshireAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jose Gabriel Ortega CastroCEOCommented:
Here you go one already created that doesn't several things as well:

https://gallery.technet.microsoft.com/scriptcenter/Copy-Files-from-folderA-to-29710ef9
0
NVITEnd-user supportCommented:
This does what you need.
- Make a file users.txt. Add this code. Add a line for each user:
user1,oldpcuser1,newpcuser1
user2,oldpcuser2,newpcuser2
user3,oldpcuser3,newpcuser3

Open in new window

- Make a file CopyUserData.bat. Add this code.
- Open a CMD window as domain admin.
- Run CopyUserData.bat
Note: It is currently in test mode for visual debugging reasons. When you are happy that's what you want, remove the echo prefixes:

@echo off
setlocal EnableDelayedExpansion

set fnusers=users.txt
for /f "tokens=1-3 delims=," %%a in ('type "%fnusers%"') do (
	rem Add more lines for each folder as needed...
	echo robocopy /e /np /ndl /nfl /r:0 /w:0 /dcopy:t /log+:robocopyLog.txt "\\%%b\c$\users\%%a\documents" "\\%%c\c$\users\%%a\documents"
	echo robocopy /e /np /ndl /nfl /r:0 /w:0 /dcopy:t /log+:robocopyLog.txt "\\%%b\c$\users\%%a\Favorites" "\\%%c\c$\users\%%a\Favorites"
	echo robocopy /e /np /ndl /nfl /r:0 /w:0 /dcopy:t /log+:robocopyLog.txt "\\%%b\c$\users\%%a\Desktop " "\\%%c\c$\users\%%a\Desktop"
)

Open in new window


Example result:
robocopy /e /np /ndl /nfl /r:0 /w:0 /dcopy:t /log+:robocopyLog.txt "\\oldpcuser1\c$\users\user1\documents" "\\newpcuser1\c$\users\user1\documents"
robocopy /e /np /ndl /nfl /r:0 /w:0 /dcopy:t /log+:robocopyLog.txt "\\oldpcuser1\c$\users\user1\Favorites" "\\newpcuser1\c$\users\user1\Favorites"
robocopy /e /np /ndl /nfl /r:0 /w:0 /dcopy:t /log+:robocopyLog.txt "\\oldpcuser1\c$\users\user1\Desktop " "\\newpcuser1\c$\users\user1\Desktop"
robocopy /e /np /ndl /nfl /r:0 /w:0 /dcopy:t /log+:robocopyLog.txt "\\oldpcuser2\c$\users\user2\documents" "\\newpcuser2\c$\users\user2\documents"
robocopy /e /np /ndl /nfl /r:0 /w:0 /dcopy:t /log+:robocopyLog.txt "\\oldpcuser2\c$\users\user2\Favorites" "\\newpcuser2\c$\users\user2\Favorites"
robocopy /e /np /ndl /nfl /r:0 /w:0 /dcopy:t /log+:robocopyLog.txt "\\oldpcuser2\c$\users\user2\Desktop " "\\newpcuser2\c$\users\user2\Desktop"
robocopy /e /np /ndl /nfl /r:0 /w:0 /dcopy:t /log+:robocopyLog.txt "\\oldpcuser3\c$\users\user3\documents" "\\newpcuser3\c$\users\user3\documents"
robocopy /e /np /ndl /nfl /r:0 /w:0 /dcopy:t /log+:robocopyLog.txt "\\oldpcuser3\c$\users\user3\Favorites" "\\newpcuser3\c$\users\user3\Favorites"
robocopy /e /np /ndl /nfl /r:0 /w:0 /dcopy:t /log+:robocopyLog.txt "\\oldpcuser3\c$\users\user3\Desktop " "\\newpcuser3\c$\users\user3\Desktop"

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rob WilliamsCommented:
There is a tool Profwiz that is great for migrations such as this.  Using the GUI, one user at a time is free, but they have a paid scripted version you might like to look at:
https://www.forensit.com/domain-migration.html
0
Member_2_7961041Commented:
SCCM Can carry out User State Migrations, would it be worth while looking to implement that as a solution? A couple of days work to set it up, but it would work better than manual migrations.
0
NVITEnd-user supportCommented:
Author's question: I would like a simple script to copy the user's profile like Document, Favorites, Desktop from their old workstation to the new ones....

... has been answered by NVIT.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.