In a Windows Active Directory environment, manually mapping network drives on individual user workstations is highly inefficient. Historically, administrators used cumbersome logon scripts (batch files or VBScript) to accomplish this. Today, Group Policy Preferences (GPP) provides a robust, graphical interface to map, update, or remove network drives dynamically based on user identity or group membership.
Why Use Group Policy Preferences?
GPP allows for granular targeting (Item-Level Targeting). You can create a single Group Policy Object (GPO) that maps the “H:” drive to an HR share only if the user is a member of the “Human Resources” security group, and maps the “S:” drive to a Sales share only if the user’s laptop is currently connected to the internal corporate network.
Step 1: Create the Group Policy Object
- Log in to your Domain Controller or a management machine with RSAT installed.
- Open the Group Policy Management Console (gpmc.msc).
- Expand your domain, right-click on the Group Policy Objects container, and select New. Name it something descriptive, like “Map Network Drives”.
- Right-click the newly created GPO and select Edit.
Step 2: Configure the Drive Map
- In the Group Policy Management Editor, navigate to User Configuration > Preferences > Windows Settings > Drive Maps.
- Right-click in the empty right-hand pane, select New, and then click Mapped Drive.
- In the New Drive Properties window, configure the following:
- Action: Select Update. (This will create the drive if it doesn’t exist, and update its properties if it does. This is generally safer than “Replace”, which disconnects and reconnects the drive, potentially interrupting active file transfers).
- Location: Enter the UNC path to the shared folder (e.g.,
\\fs01.corp.local\SharedData). - Label as: Enter a friendly name for the drive (e.g., “Company Data”).
- Drive Letter: Select Use and choose a specific letter (e.g., “S”).
Step 3: Apply Item-Level Targeting (Optional but Recommended)
If you only want specific users to get this drive:
- Click the Common tab in the Drive Properties window.
- Check the box for Item-level targeting and click the Targeting… button.
- Click New Item and select Security Group.
- Click the
...button to browse and select the relevant Active Directory group. - Click OK on all windows to save the configuration.
Step 4: Link the GPO
Finally, close the editor, return to the Group Policy Management Console, right-click the Organizational Unit (OU) containing your user accounts, and select Link an Existing GPO. Choose your “Map Network Drives” policy. When users log in, the group policy engine will evaluate the rules and map the drives seamlessly in the background.