Creating a folder in a network location using GPO - Group Policy

Posted on 2013-12-04
Last Modified: 2013-12-05
I am trying to create a folder on a mapped drive that all the users have. For example the drive is H:\ and the folder existing is "folder1". I want to create a folder in "folder1" for everyone so that it will read H:\folder1\folder2. Anyone know if this is possible by using group policy?
Question by:Wayside_Tech
  • 4
  • 4

Expert Comment

by:George Simos
ID: 39696740
So you have shared a folder on a server which is named as folder1 right?
Let's say your server's name is "FileServer1" and the physical path of the shared folder named "Folder1" is D:\Folder1.
Have you shared folder1 and given the right permissions (sharing and ntfs ones) to the users you want?
After that have you created another folder named "Folder2" under "Folder1"?
If you have done the above steps then from a windows explorer you can type:
and you will have access to the folder.
If you want now to map the path \\FileServer1\Folder1\ to H:\ you can do this either via a logon script by using the command
"net use H:\ \\FileServer1\Folder1\"

Open in new window

and putting the script file on your netlogon folder of your domain (eg \\mydomain.local\netlogon\mapdrives.cmd) and put this path in the GPO.
Alternatively if you have Windows 7 you can use Group Policy Preferences to map the drive letter to your share.
Group Policy preferences can work in Windows XP too but you have to download the following update ( but you have to manage the GPOs via a Windows Vista and later machine with the Group Policy Management Console installed via the Remote Server Administration Tools package.

What I don't understand it that you say "I want to create a folder in "folder1"" via GPO, you actually don't have to do that via GPO, you do it as described above!
LVL 14

Expert Comment

ID: 39696742
You can try using group policy preferences, configure a folder item:

I can't test this at the moment to tell you it will work definitively.

Author Comment

ID: 39696874

I thank you for your quick response. The mapped drives have already been setup. Every user that log's in has this drive being mapped. It's a folder for each user mapped according to their usernames. Each user has their own folder that is named their username.
The issue is rather than me going to everyone's computer and create this folder within the mapped drive; I wanted to create this folder using Group Policy.
The reason I want to create the folder is because I want to redirect a file to the folder . I was looking for a way to automate the creation of the folder in GPO then use another group policy to redirect a file location. But, my issue is I can't get the folder to be created in the mapped drive when I test it. Which means I can't get the file to relocate to the network location (mapped drive).

Expert Comment

by:George Simos
ID: 39696925
Let me get this straight, your final target is to redirect users folders such as "Documents", "Videos", "Desktop" etc?
Want to promote your upcoming event?

Is your company attending an event or exhibiting at a trade show soon? Are you speaking at a conference? Spread the word by using a promotional banner in your email signature. This will ensure your organization’s most important contacts are in the know.


Author Comment

ID: 39696948
Yes, I am trying to redirect the user's "Templates" folder.

Expert Comment

by:George Simos
ID: 39696950
This is a custom folder you have created I presume right?

Author Comment

ID: 39696966
No, usually the folder is found at C:\Users\"username"\AppData\Roaming\Microsoft\Templates

I am just trying to have the templates go to the mapped drive instead of locally on the hard drive.

Accepted Solution

George Simos earned 500 total points
ID: 39697039
Well you don't have to burden yourself a lot with that, especially you don't have to map it on any drive letter, the solution for you is the enabling of roaming user profiles, by doing that the %AppData%\Roaming folders of the users are moved to the network location you designate and a local cached copy is kept and synchronised during logon/logoff (you may set up policies through GPOs to sync periodically also while logged in).

You can achieve that by creating a GPO and link it on the OU with the Users you want to have such profiles.
Then edit the GPO and go to the Section: User Configuration > Policies > Folder Redirection
Right Click on "AppData(Roaming) and click properties
At the Setting dropdown select "Basic - Redirect everyones folder to the same location
At "Target folder location" select "Create a folder for each user under the root path"
In the "Root Path" box type the UNC path for the server share you have created, let's say \\FileServer1\Folder1\
Now click on "Settings" tab and check that the boxes "Grant the user exclusive rights to AppData(Roaming)." and "Move the contents of AppData(Roaming) to the new location" are checked
The final step is to decide the Policy removal which by default does not redirects back the folder when the policy is removed or is out of scope, this is something you will decide better
Finally press Apply and OK and close the GP Editor.
Now what we have achieved? Every user's Appdata(Roaming) profile folder will be redirected to the shared folder above, users don't need to have direct access there because they have a cached copy on their PC(s) but they can go and work on any pc in the premises and have their roaming profile following them!
You must keep in mind that this needs a double logon/logoff to work.

I hope this helps you.

Author Closing Comment

ID: 39698429
Very quick and consistent in answering us back! Thanks for the great suggestions and solutions.

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now