Link to home
Start Free TrialLog in
Avatar of Scott Halford
Scott Halford

asked on

Active Directory Home Folder Moves

I’ve just started to work for a school district where I would like to change the way that their Documents folders are being mapped. In the current structure they are using group policy to map the documents folder using the “Advanced - Specify locations for various user groups” and creating the users Documents folder biased upon their building using security permissions (There are 10 buildings in all)

The way I have always setup AD home folders is by using the Profile tab under the user account in AD and then mapping their documents folder based upon this location using this home folder location.

The current file structure is a follows (By Building)

- Students (root)
      - Building 1
      - Building 2
      - Building 3
      - Building ….

The way I would like it setup. (By graduating year)

- Students (root)
      -2015
      -2016
      -2017
      -20….


AD users and computers current has the user accounts separated by building OUs and Sub OUs of graduating school year. (I think this is a good thing and we will keep it this way)

Building 1
      -2015
      -2016            
      -2017

Building 2
        -2015
      -2016            
      -2017

What I need is a way to move their current home holders using Robocopy and setup some parameters using their OU membership.  I don’t mind doing this for each individual building but if I have to do each student manually it will take way too long.

The script needs to be something like this

If OU = buildingA and SUB OU = 2015
      
      move from d:\students\Building A\%username%\My Documents  d:\students\2015\%username%\Documents

Yes I want to also change the “My Documents” folder to “Documents”
Avatar of Mahesh
Mahesh
Flag of India image

In reality Home Directory is different from Redirected folders, home directories are different from redirected folders

Home directory can be set as below
\\server1\userdata\%username% where user get exclusive access to home directory

You can either move the directory first with robocopy or something else that will preserve permissions, or you can let the Folder Redirection Policy do the moving.

The best way I can see is to use robocopy command to copy all data to new location, share data as appropriate and then change path to new location
Check below articles
To set new folder redirection after you copy data with robocopy
http://blogs.technet.com/b/askds/archive/2008/06/30/automatic-creation-of-user-folders-for-home-roaming-profile-and-redirected-folders.aspx
Robocopy syntax for data copy
robocopy \\server1\users\ \\server2\users /MIR /ZB /e /Copyall /sec /secfix The above command will copy data with same permissions and same directory struccture
Make sure the setting "Move the contents of My Documents to the new location" is unchecked well in advance if you want to use Robocopy to copy files \ folders

The another option is straight:
Folder redirection policy will take care of data movement
Check below excellent articles
http://social.technet.microsoft.com/Forums/windowsserver/en-US/4e7df397-7b93-41ab-8448-2503c63568f6/how-to-move-redirected-files-from-one-server-to-another
http://technet.microsoft.com/en-in/library/cc732275.aspx

Mahesh.
Avatar of Scott Halford
Scott Halford

ASKER

I think I may not have been as clear as I should have in my first post. I want to change the file structure.  Currently the "Document" structure on the file server is as follows.

Current structure
Students (root folder)
 - Building 1 - (This is a subfolder of "Students that contains multiple graduating years. 2017,2016,2015)
 - Building 2 - (This is a subfolder of "Students that contains multiple graduating years. 2017,2016,2015)
 - Building 3 - (This is a subfolder of "Students that contains multiple graduating years. 2017,2016,2015)


Desired structure
Students (root folder)
 - 2015 (This will be a subfolder of students containing all students that will be graduation in 2015)
 - 2016 (This will be a subfolder of students containing all students that will be graduation in 2016)
 - 2017 (This will be a subfolder of students containing all students that will be graduation in 2015)

I will need logic that looks at the AD OU structure and username to move the current documents folder into the new structure without changing the permissions.
You can't use robocopy to copy permissions in this case

you need to create multiple AD groups for every year (Ex:2015, 2016 etc) and add all respective users to that group
In existing redirection policy, you need to Make sure the setting "Move the contents of My Documents to the new location" is checked \ selected in advance and allow it to replicate to all desktops for at least one week

Then you need to add more paths in existing redirection policy to reflect new paths
for ex: original path is \\server1\students\Building1\2015\
The destination path should be \\server1\students\2015 with "redirect to the following location" selected (offcource you have to pre create AD group named 2015) for this to work

Test this on test user 1st
Hi again,

We have an issue with solution that you provided. Our users currently do not have home directories and we would like to migrate their current documents so that we can enable home directories.  I found this tech document that seems to state what we are trying to do is not possible through a redirection policy http://msdn.microsoft.com/en-us/library/cc786749(v=ws.10).aspx your help is greatly appreciated.
Sorry I should of mentioned the line I was referring to in the msdn document. "A home directory (only applicable if you have existing home directories in your environment)"

We need to integrate the home directories so that we can fully setup the Magic Triangle with our newly purchased Macs.
You need to create home directories explicitly and then need to copy user redirected data to respective home directories

You can create root share such as \\server1\userdata\2015, \\server1\userdata\2016 and so on
On batch of 2016 users, select all users and go to properties and enter
\\server1\userdata\2016\%username%
This will ensure that home directories will be created for all users

Then copy user data to home directories with some small script \ ask user to do that

I think If you could explain what you are trying to do exactly, I can help
Mahesh,

I have created home directories for our users on the new server.  The file structure is as follows..

Students(root folder)
 - 2015 (folder in which all students home folder who graduate in 2015 are located)
 - 2016 (folder in which all students home folder who graduate in 2015 are located)
 - 2017 (folder in which all students home folder who graduate in 2015 are located)
 - ETC

Each student is separated by a building OU and by their graduating year. For instance the students in the building Bosti and that are graduating in 2021 are located in the following OU

OU=2021,OU=Bosti,OU=Students,OU=Instructional,DC=CSDFM,DC=local

I need a script that will look in a specific OU (lets use the case above) and match user names using a loop using RoboCopy. I know this seems crazy but the current location of the documents folders are organized by building, not grade year. I will give and example below. Please excuse my coding :)

$A = 2021
$B = Bosti

If a students OU=$A and is located in OU=$B
then username output = $C
 
For number of users in OU=$A

Robocopy.exe "O:\\Instructaional\Student Documents\Bosti\2021\$C O:\\Instructaional\Students\2021\$C /E /SEC /COPYALL /V /ETA /TEE /ITEM


If you could solve this issue it would be greatly appreciated!
I am not scripting expert, somebody scripting master can help you with the script

Better you could ask moderator to direct this question to scripting masters

According to me ask users to move there data from respective locations to home directories, this can be simplest solution
Good Luck
ASKER CERTIFIED SOLUTION
Avatar of Scott Halford
Scott Halford

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
All other comments did not lead me to the correct solution. I needed to research outside sources to find the desired results