Thursday, March 13, 2014

Notes on moving Active Directory redirected folders between file servers

I’ve recently had to perform a file server migration from a Windows Server 2003 to a Windows Server 2008 R2 server which contained users’ Active Directory redirected folders.  It’s been awhile since I’ve had to move redirected folders and I realized how I forgot the behavior of the settings so in case I have to do it again sometime in the future, I thought I’d write a quick blog post on some gotchas I encountered during testing.

Basically what I did to move the data was a robocopy script that be found in one of my previous blog posts here:

Robocopy script for copying and synchronizing files and folders when migrating Windows file servers
http://terenceluk.blogspot.com/2013/08/robocopy-script-for-copying-and.html

After getting the files to the new file server, I went ahead and exported the registry containing the file share and permissions from the old file server, edited out the ones that weren’t required and re-imported it into the new file server.  A quick reboot of the new file server showed that the folder shares were recreated properly.  Next, I went to check the folder redirection for the Documents folder and if the settings of the redirected folders are set as such:

Setting: Basic – Redirect everyone’s folder to the same location

Target folder location: Create a folder for each user under the root path

Root Path: \\yourOldFileServer\Users$

image clip_image002

You shouldn’t simply change the Root Path to \\yourNewFileServer\Users$ and call it a day because the redirected folders will not redirect properly.  Users will basically see an empty documents folder and when they attempt to create a folder, they will receive the following error:

Unable to create the folder 'New Folder' File system error (512).

The reason why this wouldn’t work is because as the settings show, the Active Directory GPO will attempt to do one of the following:

1. Assuming you still have the old file server on, it will try to create a new folder on the new file server and because the folder already exists, it will fail. 

2. If the old file server is turned off or the shares have been removed, it will fail because it is unable to copy the files over.  The event logs of the desktop will log the following event ID: 502 errors indicating that the old redirected folder cannot be accessed:

image

Failed to apply policy and redirect folder "Videos" to "\\bdafs01\Users$\tl\My Documents\My Videos".

Redirection options=0x80009211.

The following error occurred: "Failed to redirect because the destination directory "\\fs01\Users$\tl\My Documents\My Videos" is offline".

Error details: "The network path was not found.

".

image

Failed to apply policy and redirect folder "Pictures" to "\\bdafs01\Users$\tl\My Documents\My Pictures".

Redirection options=0x80009211.

The following error occurred: "Failed to redirect because the destination directory "\\fs01\Users$\tl\My Documents\My Pictures" is offline".

Error details: "The network path was not found.

".

image 

To get around this, you can either leave the GPO set as the above but remove all the users’ redirected folders from the new file server and simply let the GPO move the folders over.  This obviously may not be the best idea if you have a lot of users because there might be a lot of data to move so the alternative option is to modify the settings as such:

Setting: Basic – Redirect everyone’s folder to the same location

Target folder location: Redirect to the following location

Root Path: \\yourOldFileServer\Users$\%username%\My Documents

image clip_image002[6]

What we’re basically doing is simply set the redirected folder path to the new file server with the migrated data and deselecting the Move the contents of Documents to the new location so that the GPO does not attempt to move data to the new folder.  I can also confirm that these settings will continue to create new redirected folders for new accounts.

2 comments:

Gary McCabe said...

Terence,
I recently went through a similar experience. I intend to move users as they changed to a different by using DFS. I had problems with DFS namespace so will manually move when they change locations by changing the user OU in active directory. My concern was answered at the end of your article. What happens when I create a new user. You verified that I do not have to create a different OU for getting the directories created.

Your article helped clarify how folder redirection works.
Thanks,
Gary McCabe
Indianapolis

Akashiwagi said...

Terence,

Did you mean to set the root to the new file server in the last step of the workaround right?

Setting: Basic – Redirect everyone’s folder to the same location

Target folder location: Redirect to the following location

Root Path: \\yourOldFileServer\Users$\%username%\My Documents

or

Root Path: \\yourNewFileServer\Users$\%username%\My Documents

Thanks for this!
Akira Kashiwagi