Map Network Drive in Windows Server 2008 R2 via GPO

active-directorywindows-server-2008

I'm trying to map a network share in Windows Server 2008 R2 x64 for hours now. We have an AD Domain, DNS, etc. It is working. I have a batch file which contains only 1 line.

net use z: \\Storage\backup /persistent:yes

and I have a GPO. What I tried until now:

Setup batch file in the GPO as

Startupscript (Computer Configuration – Windows Settings – Scripts – Start),
put the batch under

\\domainname\SysVol\domainname\Policies\{GUID}\Machine\Scripts\Startup

setup batch file as

Logonscript (User Configuration – Windows Settings – Scripts (Logon/Logoff) – Logon),

put it under

\\domainname\SysVol\domainname\Policies\{GUID}\User\Scripts\Logon

and also under \\domainname\NETLOGON

Then I discovered that Logon scripts and UAC don't play well together, so I tried Microsoft's preferred workaround described here.

So same thing as above with launchapp.swf and my batch as parameter. I also tried "EnableLinkedConnections" as described here. And I have "Always wait for the network at computer startup and logon" enabled in the GPO. The user on the Server is a local administrator and I can not change this. I'm viewing the server via Remote desktop and I always did gpupdate /force after changing the GPO…
The drive won't map and I don't see an entry in the Event Viewer. I'm lost and frustrated, please put me in the right direction.

The share is read only for normal users and writable for the user who logs on to the server which I want the drive mapped to. If I execute the batch and/or the launchapp.wsf after logging in, everything works fine. Sorry for my bad english.

Best Answer

I'm not sure if this is exactly what you are trying to do, but I recently moved from a script to map network drives to using Group Policy Preferences to do this. The level of control and automation is incredible. Here is the Microsoft "Getting Started" link. There are a ton of references on the web that go into greater detail about the types of things that you can besides just map drives.

We have different shared drives for different departments, and some people should have access to multiple drives. GPP allows us to assign the drives to specific Organizational Units, Security Groups, or pretty much any level of targeting that you can imagine. This greatly simplifies setting up new computers for users.

We also use this for Shared Printers, if that is something you do as well.

Some issues that we have run into, Windows XP machines must have a few prerequisites installed before they can process the GPP. We also had to set each mapped drive to "run as the logged on user", to ensure that the proper permissions were set so that the drives would actually mount.

This could be an alternate route around your problem, while at the same time, providing a more "visible" method to administer these shares.