3

Although I thought this would be easy I am unable to automatically connect to a network drive via GPO.

I tried through a batch file on (User Configuration / Policies / Windows Settings / Script / Logon) which I made sure to browse via NETLOGON share.

File Content:

net use z: \\\Shares\DMS

A finally I also used the Drive Maps (User Configuration / Preferences / Windows Settings / Drive Maps) with following parameters:
Action: Replace - Location: \Shares\DMS - Reconnected: Checked - Use: Z: - Hide/Show this drive: Show this drive - Hide / Show all drives: Show all drives.

By reading some tips in the Internet I also disabled the fast logon.

Just to make sure, I tested the batch file and the NETLOGON share in a target laptop, and everything worked fine.

This is the gpresult /z for a target laptop:

Logon Scripts

GPO: Default Domain Policy
    Name:         \\PM01-W12-DCO\netlogon\logon.bat
    Parameters:
    LastExecuted: This script has not yet been run.
  • See this article [http://blogs.technet.com/b/askds/archive/2009/01/07/using-group-policy-preferences-to-map-drives-based-on-group-membership.aspx](http://blogs.technet.com/b/askds/archive/2009/01/07/using-group-policy-preferences-to-map-drives-based-on-group-membership.aspx) It may be an old article but this is still today the best and most reliable way of mapping drives. –  Dec 11 '14 at 10:00

3 Answers3

3

I just ran into this issue on a Windows 10 laptop and learned that it's a known issue with Windows 8/10 and Server 2012.

If the reconnect option is checked in the drive map, it will just fail, no errors or issues in event viewer that I could see. As soon as I unchecked the reconnect option, replicated changes and then ran gpupdate /force on the Win 10 laptop in question the drive mapped without issue.

Check this link for further details and screenshots

Lago
  • 31
  • 1
2

Given that you've tried two techniques without success, I'd say this is almost certainly going to come down to a permissions issue.

Go back to using Group Policy Preferences - you can then review the event log to see why they're failing.

Edit: Please don't use the Default Domain Policy for this stuff, if you break it you'll be stuffed. Create a new GPO and link it as appropriate.

Dan
  • 15,430
  • 1
  • 36
  • 67
  • Hi Dan. Does this help us somehow? Logon Scripts ------------- GPO: Default Domain Policy Name: \\PM01-W12-DCO\netlogon\logon.bat Parameters: LastExecuted: This script has not yet been run. –  Sep 07 '14 at 19:28
  • No - use Preferences and take a look using Event Viewer – Dan Sep 07 '14 at 19:35
  • Sorry for being so noob, but I am afraid I dont know how to do that. What exactly do I have to do in the preferences? What kind of log do I have to check. Thanks! –  Sep 07 '14 at 19:51
0

Not to necro this thread, but in case others run into this issue:

The issue (I believe) is that your script is located in a directory that lacks the required permissions. When you go to add your logon.bat to the logon settings in your GPO make sure to move the logon.bat to the folder that the "add" then "browse" button defaults to and not just point to where the script is currently located on your system. Your directory will be specific to your server, but it should resemble something like this (the $ALLCAPS$ portions being the parts specific to your server/domain):

\\$YOURDOMAIN$\sysvol$YOURDOMAIN$\Policies{$YOUR-DOMAIN-ID$}\USER\Scripts\Logon

After moving my batch file to the correct directory, it ran flawlessly.

Trevor
  • 1
  • 1