[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Folder Redirection based on site

Posted on 2014-08-24
25
Medium Priority
?
126 Views
Last Modified: 2014-09-18
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?
0
Comment
Question by:schmad01
  • 13
  • 8
  • 3
  • +1
25 Comments
 
LVL 26

Expert Comment

by:Sekar Chinnakannu
ID: 40282309
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
0
 

Author Comment

by:schmad01
ID: 40282330
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.
0
 
LVL 6

Expert Comment

by:Flipp
ID: 40283374
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.
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
LVL 12

Expert Comment

by:Steven Wells
ID: 40284343
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.
0
 

Author Comment

by:schmad01
ID: 40284368
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?
0
 
LVL 12

Expert Comment

by:Steven Wells
ID: 40284421
In Group Policy Management console, down near the bottom you have Sites.
0
 

Author Comment

by:schmad01
ID: 40309145
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?
0
 
LVL 12

Expert Comment

by:Steven Wells
ID: 40309386
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.
0
 

Author Comment

by:schmad01
ID: 40326902
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.
0
 
LVL 12

Expert Comment

by:Steven Wells
ID: 40326913
Give me a bit and I can send you something
0
 

Author Comment

by:schmad01
ID: 40326950
Thank you.
0
 
LVL 12

Accepted Solution

by:
Steven Wells earned 2000 total points
ID: 40327039
HI,
Please have a look at the attached file. Rename to .vbs

Adjust to your requirements.
MapDrivesbysites.txt
0
 

Author Comment

by:schmad01
ID: 40327164
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?
0
 
LVL 12

Expert Comment

by:Steven Wells
ID: 40327170
Hi. Replace as you see fit to adjust to your needs.  😊
0
 

Author Comment

by:schmad01
ID: 40327176
Ok, I'll get back to you tomorrow.
0
 
LVL 6

Expert Comment

by:Flipp
ID: 40327180
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.
0
 

Author Comment

by:schmad01
ID: 40331710
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.
0
 

Author Comment

by:schmad01
ID: 40331722
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?
0
 
LVL 12

Expert Comment

by:Steven Wells
ID: 40331730
You can just comment those lines out or run the script using cscript
0
 
LVL 6

Expert Comment

by:Flipp
ID: 40331751
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.
0
 

Author Comment

by:schmad01
ID: 40331895
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.
0
 
LVL 12

Expert Comment

by:Steven Wells
ID: 40331915
You could try and change the line to say if name in string rather than a direct match.

Ie if instr("xyz") then
0
 

Author Comment

by:schmad01
ID: 40331936
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.
0
 

Author Comment

by:schmad01
ID: 40331962
Nevermind, I got it.
0
 

Author Closing Comment

by:schmad01
ID: 40331964
That solution worked great! Thank you.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office 365 is a subscriptions based service which includes services like Exchange Online and Skype for business Online. These services integrate with Microsoft's online version of Active Directory called Azure Active Directory.
How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

873 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