The most common way the map network drive is with a Group Policy (GPO). The advantage of a GPO is you can easily manage, create and change multiple drive maps. It also allows us to configure different drive maps depending on the device or user with the help of Item-level targeting.
When creating a new policy we can choose to link it to a user’s OU or computer OU. The difference between the two is:
With drive mapping policies, however, it’s best practice to create only a single policy for all drive maps. We can use item-level targeting per drive map to give only the selected users, groups, or computers access to the drive map.
The advantage of this method is that it’s easier to process during login for the client computers and easier to manage. Because you will have all drive mappings in one overview, instead scattered around in different policies. So create your new drive mapping policy in a high-level OU, for example, Users, or Computers.
In the New Drive Properties dialog, we will need to configure a couple of options. The first one is the action. Let me explain the differences between each action:
The best option is to use Update when creating the mappings. This way you are always sure that the user will have the correct drive mapping. The potential problem with Replace is that it may disconnect the drive briefly every 90 mins during the GPUpdate cycle. This can cause problems with specific applications.
Tip
Create a CNAME record in the DNS server for the file server. The CNAME record is an alias and makes it easier to move the shared folders to a new server later on.
The option Hide/Show this drive in the lower left corner allows you to create hidden drive mappings. This can be useful when you need to create a drive mapping for an application, but don’t want to give the user direct/easy access to it. Hidden drives can still be accessible by the applications (although I recommend just use the UNC path in the application if possible)
We will now need to configure the Item-level targeting and enable the user security context for the mapped drive. The first will make sure that the drive mapping is applied to the user’s account. The Item-level targeting ensures that only specific users or devices gain access to the drive mapping, instead of all users.
Good to know is that you can re-use drive letters when using Item-level targeting.
Targeting can be done on a lot of conditions and we can even apply multiple conditions with AND or OR statements. The most common however is to apply the mapping based on Security Groups, OU, or specific users.
For example, to give all users that are members of the IT security group access, we can configure the following:
As mentioned, we target multiple groups. Let’s say we want to map the network drive to not only members of the IT department but also Management.
The mapping will now be applied to users that are either members of the IT or management security group.
The item-level targeting also allows you to create collections. Collections are a group of rules that need to be true in order for the collection to be true. The advantage of collections is that you can create different combinations and test each of them.
For example, we want to create a drive mapping that is being applied to all IT members or to users that are members of the security group Management and are working on a computer in Amsterdam.
For the IT department, we can use a normal rule based on the security group. But of the management we will need to create a collection:
Good to know, is that you can also use variables when creating drive mappings. For example, when you offer a home drive (personal folder) on the file server, then we can use the user’s logon name in the folder location path.
To see which variables are available, press F3
when you have the New Drive Properties dialog open. This will give you a list of all options that you can use. Always make sure that you enable the option Run in logged-on user’s security context under the Common tab.
After you have created the new GPO, we will need to verify it, optimize, test, and assign the policy. The first step is to verify the settings. Open the Settings tab of the GPO and verify the configuration.
The next step is to optimize the performance of the GPO. In this case, we create a policy with only user settings. To speed up the group policy processing time we can disable the computer configuration for this policy:
The last step is to assign the policy. Important is to always test your new policy with a small group of users or computers. After you have verified that it’s working correctly, you can assign it to all the users that need the policy.
To assign the policy, simply navigate to the OU where you want to assign the policy, right-click on the OU and choose Link an Existing GPO. Select the newly created policy from the list to assign it.
You can also manually map a network drive in Windows 11. This is particularly handy when you only need to map the drive temporarily or in home network environments where you don’t have a domain controller of course.
Mapping a network drive in Windows 11 is pretty easy: (you can find the steps for Windows 10 in this article)
In the next screen, we can configure the drive letter and network folder to open. Make sure that Reconnect at sign-in is checked, otherwise, you will need to re-add the drive letter if you have logged in.
The option Connect using different credentials allows you to make a network connection to a shared folder with different credentials. For example, when you have a NAS, you will sometimes need to enter the credentials of the NAS in order to open the shared folder.
Drive mappings are applied after the next policy update, which occurs roughly every 90 min, but you can also for the update with the command GPUpdate. The easiest way to verify the drive mappings is to open the explorer. But that doesn’t work for hidden drive mappings.
In these cases, you can use the command Net Use. When you run this command in the command prompt or PowerShell, you will get an overview of all mapped network drives, the drive letter, and the network folder.
If the policy isn’t applying, then verify the policy with the RSOP utility This built-in tool allows you to verify group policy and find any problems that might have occurred in the background.
Using one Group Policy for all your drive mappings based on item-level targeting is the best practice to follow. It makes it easier to manage your mappings and it will speed up the logon process.
If you need to map a lot of network shares, then it’s sometimes better to map the parent folder and give the correct permissions on each subfolder, instead of mapping each subfolder.
I hope you found this guide useful, if you have any questions, just drop a comment below!