Solved

robocopy or powershel to migrate home folders

Posted on 2016-09-08
9
33 Views
Last Modified: 2016-10-28
dear experts

I have over 100 home folders I need to migrate ( leave no copy behind) a new folder called "migrated_users" in a new folder in the same volume

is it possible to take ownership of users' home folders and putting them in a new folder with robocoy or powershell?

I have a list of users in a csv file with their samaccoutnames that script needs to look and   find their home folders  in a share (\\servername\sharename\home) and then place them in a new folder (\\servername\sharename\home\migrated_users)  

regards
0
Comment
Question by:kuzum
  • 4
  • 3
9 Comments
 
LVL 27

Expert Comment

by:serialband
Comment Utility
You should be able to run robocopy in an elevated administrator command prompt:

robocopy \\servername\sharename\home \\servername\sharename\home\migrated_users /mir /copyall

Are you having access problems?
0
 

Author Comment

by:kuzum
Comment Utility
no access problems but would be better to avoid access problems if there are any folders that I don't have access but administrator is the owner of the folders and some owned by users themselves.

your script would copy everything in the share which I do not want. it needs to copy specified users
0
 
LVL 27

Expert Comment

by:serialband
Comment Utility
foreach  %i in (userlist) do robocopy \\servername\sharename\home\%i \\servername\sharename\home\migrated_users\%i /mir /copyall
0
 
LVL 27

Assisted Solution

by:serialband
serialband earned 334 total points
Comment Utility
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:kuzum
Comment Utility
Hi Serialband,

both scripts won't do what I am trying to achieve. it is looking for a source and destination locations to copy everything over.

with the Robocopy still not sure how it is importing userlist to search in a source location...

thanks
0
 
LVL 27

Accepted Solution

by:
serialband earned 334 total points
Comment Utility
For the scripts, you need to replace the sourcepath and destination paths with those of your system.

In the foreach loop, you need to replace userlist with a comma separated list of files.

If you want to load the list from a separate text file, you'll need to do the following:

for /F "tokens=*" %i in (userlist.txt) do robocopy \\servername\sharename\home\%i \\servername\sharename\home\migrated_users\%i /mir /copyall
0
 
LVL 19

Assisted Solution

by:compdigit44
compdigit44 earned 166 total points
Comment Utility
Here is a thought.

1) On the current home folder directory use icacls.exe to export the ACL's of all folder and file permissions
http://www.sherweb.com/blog/viewing-saving-and-restoring-ntfs-permissions/

2) Run robocopy to copy all data to new directory structure

3) update the icacls text file export to include the new directory path and import

****** Test everything before doing it in production******
0
 

Author Comment

by:kuzum
Comment Utility
resolved this using third party tools.
0

Featured Post

Too many email signature updates to deal with?

Do you feel like you are taking up all of your time constantly visiting users’ desks to make changes to email signatures? Wish you could manage all signatures from one central location, easily design them and deploy them quickly to users? Well, there is an easy way!

Join & Write a Comment

"Migrate" an SMTP relay receive connector to a new server using info from an old server.
Synchronize a new Active Directory domain with an existing Office 365 tenant
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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

763 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