Map Network Drives with Group Policy in windows server 2022
Tags: grouppolicy, activedirectory, administration
Published: 2024-03-23 14:29:34

**Hello** everyone
It is my pleasure to create my first post in Dev.to.
Recently, I tried to map network drives with group policy in windows server 2022, but failed.
In this article, I am going to explain how to map network drives with group policy and what my fault was.
If you’re still using login scripts then it’s time to switch to Group Policy.

## HOW TO - Map a Department Network Drive Using Group Policy

<u>Step 1: Create & Link a new GPO</u>

1.Open the Group Policy Management Console
![Open the Group Policy Management Console](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6043be0ej0fdkrcjxp7t.png)
2.In the Group Policy Management Console, Right Click and Select “Create a GPO in this domain, and Link it here”

TIP: This will be a user based GPO so make sure you link the GPO to a location that will target the users.  I have all of my users separated into an OU called ADPRO Users, I’ll create and link the GPO there.
![Right Click and Select Create GPO...](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ef9lp9t900orl64dpvpa.png)
3.Name the new GPO

You can name the new GPO whatever you like, I’ve named mine "Users – Mapped Drives"

![Name the new GPO](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4fxr19l6j0irzvf46qvi.png)

I can later add additional drive mappings to this GPO.
The new GPO is now created and linked, now it’s time to configure the settings.

<u>Step 2: Configure GPO Settings</u>

1.On the GPO right click and select edit
![select edit](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwev2lmkeg1okj4zwspa.png)
2.Navigate to User Configuration -> Preferences -> Windows Settings -> Drive Mappings
![drive mapping](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l1yiioeqic162sn3i20i.png)
3.Right Click Drive Mappings, Select New – > Mapped Drive
![new mapped drive](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6erefa27tfalahjy2avx.png)
4.Configure Drive Mapping Properties

General Tab Settings

- In location put the path to the share/folder you want to map a drive to.
- Select a drive letter
- Choose Update for action
- Label as: This is optional but may be beneficial for users.

![configure tab setting](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hj5bayss50itg8u6bax8.png)

* Common Tab Settings
* Select “Run in logged on users’s security context
* Select Item-level Targeting
* Click the Targeting Button
![configure targetting](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0i4t94e3u4rdxvbs362p.png)

Select New Item

Select Organization Unit then select the OU you want to target
![Select New Item](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g8myl3jjxwfhkw0aoqj8.png)
Click OK, Click OK again to close the new drive properties
This completes the GPO settings

<u>Step 3: Reboot Computers to Process GPO</u>

For the GPO to run I will need to reboot the users PC or run gpupdate /force. The next time a user from the HR department logs in they should see a mapped drive.

I’ve rebooted the computer, now I’ll log in with an account that is in the HR organizational unit.
![reboot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g2m87bp6ttf06x1591ev.png)
Once logged I will go to file explorer and check for the mapped drive.


![Mapped drive show](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/windb3b329rdxhh16wge.png)

It works.

Now, any user I put in the HR folder will get this mapped drive. If you don’t want to use an OU you can also target a group of users by using a Security group.


## What was my fault?

I tried to create GPO for ADPRO Groups, not ADPRO Users.
This was my fault

## What I find:
The drive mapping is a user configuration only.