Link to home
Start Free TrialLog in
Avatar of David Schmalzer
David SchmalzerFlag for United States of America

asked on

Folder Redirection based on site

I have 3 sites linked by vpn with their own subnets and their own domain controllers. My question is two-fold. I would like to re-direct all user's documents to their home drive but based on site. I have replication and namespace enabled so all user's folders are replicated to each server.
First, how can I set up folder re-direction in group policy to re-direct user's documents to their site-specific server?

and

Once this is successfully implemented, will it automatically move the user's existing documents from their local folder to the server share?
Avatar of Sekar Chinnakannu
Sekar Chinnakannu
Flag of Singapore image

Create a OU for three different site and set the policy, Goto GPO -> User Configuration > Windows Settings -> Folder Redirection\My Documents -> Right-click My Documents -> click properties -> Target tab -> click Basic -> Redirect everyone's folder to the same location -> Under Target folder location select the option\configure as per your need.

If you need more details you can review the MS recommendations too http://msdn.microsoft.com/en-us/library/cc785925(v=ws.10).aspx
screen.JPG
Avatar of David Schmalzer

ASKER

Are you suggesting that I put users in the newly created OU? That may not work as users may move from site to site and I do not want to use roaming profiles either.
Can you map drive based on % LOGONSERVER%? I was looking at doing something similar in a few months an wo dered whether this would work.
You can also apply GPO objects to the Site level. That way it will query the Site to apply your Folder Redirection Policy.
Then you can leave your staff in the same OU.
I like both Flipp's and Steven's suggestions. Not sure how to apply GPO objects to the site level. Can you give me some insight on that?
In Group Policy Management console, down near the bottom you have Sites.
I think I want to map drives. I would like to do this based on the user's computer name. How can this be done?
You can write a VB script that checks the name of the computer.   There are plenty of examples on the net how to do this.
I tried the gpo policy route but was not successful. I want to move on to vbscript. I tried searching on web but can find nothing useful. I want to map a drive to a user's home folder on a specific server based on the user's computer name.
Give me a bit and I can send you something
Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Steven Wells
Steven Wells
Flag of Australia image

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
Wow, thanks,
That looks good, let me have some time to go through it and adjust names and test. Is the Home$ a hidden share? I already have a non-hidden share called "users" in which all user folders are. I assume I can replace the Home$ with users?
Hi. Replace as you see fit to adjust to your needs.  😊
Ok, I'll get back to you tomorrow.
I am curious why you had issues with GPP to map a network drive? I use it religiously with zero issues. Might be worth getting it working for greater flexibility.
Flipp, I created a GPO policy and linked it to the site I was testing, set up the mapped drive, performed a gpupdate /force
and tested. It did not work. My target was \\jmvfc-server-1\users\%username%

I heard that the variable %username% does not work in Group Policy. I then tried %logonuser%

That didn't work either.
Steven Wells,
You script worked great. I like the information pop-ups but don't want the user to have to click  OK to move on. What do I need to change for this?
You can just comment those lines out or run the script using cscript
I can't get onto my Servers to check, but you could refer to http://www.alexcomputerbubble.com/using-group-policy-preferences-gpp-to-map-user-home-drive/ which talks about it.
Steven Wells,
One more question, For the arrays, instead of listing all computer names, can I just use a partial computer name? For example at site 1, all the computer names are named like jmvfc-1-1, jmvfc-1-2, etc. What if I just wanted to use jmvfc-1?
It would be tedious to keep changing computer names as new pc's are added.
You could try and change the line to say if name in string rather than a direct match.

Ie if instr("xyz") then
Ok, that works. One thing I noticed though, that if the drive is already mapped, the script displays an error. I need it to either resume on error or remove mapped drives in the beginning before mapping.
Nevermind, I got it.
That solution worked great! Thank you.