Windows Server Summit 2024
Mar 26 2024 08:00 AM - Mar 28 2024 03:30 PM (PDT)
Microsoft Tech Community

VBScript logonscript

Copper Contributor

Hello, i come here because i have a problem:

 

I currently have an active directorie domain server on Windows Server 2012 R2, with a logonscript.vbs (script that allows you to do actions when connecting to a domain session).
I would like to know how to change the location of personal folders (downloads, images, videos, documents) from local to a network drive. I know that in the properties of the folder we can, but I would like to do it with the script to be sure that there is the right location at each logon. Below is an image to help you better understand.

 

Thank you all and have a good day
Kind regards
Nicolas

 

Capture emplacement téléchargement forum microsoft.PNG

 

 

 

27 Replies
Thank you for your response. The page is down, 404 error. Do you have an another solution ?

Thank you
Will it work if I also have a script associated with the logon?

Thank you
If you're logonscript does the same perhaps, but you can combine it in one Group Policy or create a new one and link it one position higher. Let us know how it works out for you
At the moment, the script just adds network drives and attributes a letter according to the chosen user account
Ok, then it shouldn't be a problem adding Folder Redirection in the mix
I did not specify but I want the redirection to do it according to the users, like in dynamic i think
With a %username% path in it? What is dynamic in your case?
Sorry, I use a translation solution, it's not very efficient. I want to redirect folders based on logged-in users. Example, user A is not going to have the same redirects as user B

But if the folders are all in the homefolder of the user, then you can use the %username% variable or %homepath% / %homefolder%. (You mention personel folders, I assume they are in the homedrive)

The home directory is a personnal directorie (downloads, videos, images ...) but I want to redirect it on a network drive. Different users each have their own folders with permissions

With folder redirection you can move existing folders to a network location, but is the desired folder the one specified in the homefolder properties of the Active Directory user? Then you can use the variables like I mentioned. If not, then you have to create a Group Policy per user which isn't very handy...
I just saw I didn't specify the most important, sorry!! The home folders (personal folders) are on the machine locally. Basically with a network session, I want to redirect a local folder to a network drive, based on network permissions.
Can I link a GPO to a user?

Redirect as in move the current local data to a network drive and configure My Documents, My Pictures to that? Yes, that's possible and you should create a general Group Policy which moves it to the Homedirectory but then you need that to be specified in the user account. You can link Group Policy to users or groups (And devices) 

Yes, that's what I'd like. But just when you connect it to the domain, and not locally on the computer
For example, I create a document folder on my share, and when you connect to the domain, the location of the documents locally is redirected to the share, in the new folder
only what is modified when you are in a network. All documents that are added with a local user are not affected.
Seems like you want Offline Files... Connect to the domain in your case is when you're back at the office, laptop users?