Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

moving the target of my documents through script 1

Status
Not open for further replies.

jtcdesigns

IS-IT--Management
Oct 22, 2007
26
0
0
US
I have recently come across a new project at work. I and setting people up in groups in our active directory server and I would like to automatically map someone's my documents folder to a new location other than local. Currently I just do it manually. I was wondering I would need a script to acknowledge what the username is that the person is logged into and then do an if then else statement for example

if username = steve then
move documents target to steve's folder
elseif username = jane then
move documents target to jane's folder
end if

Of course that isn't the code I just want to give an example of what I want to do. I have seen scripts to find a username but I haven't seen a script to move the target of the documents folder. I of course will be looking that up soon but I was just wondering if this is the best way to do it or is there an easier way that what I imagine?
 
Use the folder redirection capabilities of Group Policy instead. Make sure you click the settings tab and set the policy to return the folder to the original location when the policy is removed.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
I did that but I would have to do that for every user there is. Though I guess it would be the same thing as writing a script for it all. Though when I do it in group policies it doesn't actually move the documents folder target. It just mounts a drive that I link to where I want their documents to be then I move the target of the documents folder to that drive letter. I just want something that will do the same function as clicking move and changing the target.
 
Sounds like you are using local policy instead of domain policy. If you use a domain level GPO, it will move the existing documents to a folder on the network.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Hmm, but if I do it at t he domain level GPO wont it map the same location for everyone in the group? What I was doing was going to properties of the user and under the profile tab mapping the home folder. Which I realized isn't what I want done.
 
The GPO creates a folder for each user in the specified location.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top