Advertisement

11.20.2008 at 12:41AM PST, ID: 23920798 | Points: 500
[x]
Attachment Details

Migrate Users Home directories with a script

I want to produce a script that can migrate users home directories from one file server - to another.
In the process there should be a check for open files, and after succesful migration NTFS rights should be assigned, and attributes in AD should be changed.

Users home directories are located in D:\Home\ and the folders names = %username%.
I would like the script to read users from a file, and output events to a logfile.


In sequence - this is what I have in mind (Batch script for simplicity):

1. Check if folder contains open files, if yes then log the user and go to the next user
2. Robocopy files (synchronizes changes), log event
3. Set correct NTFS rights on folder (users:N %username%:M domain admins:F)
3. Update Active Directory (dsmod user %username% -home H: \\NewServer\Home\%username%), log event
4. Add membership for user (add group Home_Migrated, log event


I am going to migrate 25 000 users home directories, so perfomance is an issue - should I run the job on the old server or the new server?
Any other thoughts I may have missed?
Top Expert: sirbounty
Expert Since: 10/17/2003
Accepted Solutions: 7992
Computer Expertise: Guru
Education: American Sentinel University, Bachelor's Degree
sirbounty has been an Expert for 5 years 2 months, during which he has posted 47001 comments and answered 7992 questions. sirbounty is just one of 1209 experts in the Windows Batch Scripting Zone.
 
 
 
 
20081119-EE-VQP-48 - Hierarchy / EE_QW_2_20070628