Mapping Drives via Group Policy login script (2008 domain with Windows 7 & 8 clients)

I'm having trouble getting drives mapped for my domain. I few months ago we were using Group Policy Preferences to map drives, but for some reason it stopped working - so I created a few login scripts for the various divisions in my company to map drives. But those didn't completely work either.

As far as I can tell the GPOs with the login scripts are being ran upon login, but the drives are still not being mapped. Manually executing the .vbs script successfully maps the drives, it's just not mapping them when the user logs in.

Running gpresult /r shows the login script GPO was ran, and viewing the Applications and Services\Microsoft\Windows\GroupPolicy\Operational event log, I can see the Event 4016 where it says:

Starting Scripts Extension Processing.
List of applicable Group Policy objects: (Changes were detected.)
Share Drives GPO

So the GPO is being run, and the script works when executing manually - but the drives are not being mapped when the user logs in. Here is a sample from the script I am using:

On Error Resume Next
If err.number = vbEmpty then
Set objShell = Create("WScript.Shell")
objShell.run ("Explorer")
ElseIf err.number = -2147022646 then
Wscript.Echo "You must create" & strDriveLetter
Else Wscript.echo "Unknown " & err.number
End if

' Map H Drive
Set objectNetwork = CreateObject("Wscript.Network")
objectNetwork.RemoteNetworkDrive "H:"
objectNetwork.MapNetworkDrive "H:", "\\Path\to\FileServer"
Set objectShell = CreateObject("Shell.Application")
objectShell.NameSpace("H:").Self.Name = "Name Applied to Drive Letter"

' Map I Drive
Set objectNetwork = CreateObject("Wscript.Network")
objectNetwork.RemoteNetworkDrive "I:"
objectNetwork.MapNetworkDrive "I:", "\\OtherPath\to\FileServer"
Set objectShell = CreateObject("Shell.Application")
objectShell.NameSpace("I:").Self.Name = "Name Applied to Drive Letter"


and so on for each drive letter that applies to the user.

• login script mapping will map your drive to "administrative context" if UAC is enabled. You should keep troubleshooting preference. Loginscript mapping is obsoleted. What is the result if you use "net use" to map? – strongline Nov 20 '15 at 19:37
• Can you elaborate on that first sentence? Do you have a source? We do have UAC enabled. Are you saying that disabling UAC would allow login scripts to work? Shouldn't the UAC prompt show up upon login to allow the script to execute? – Arindrew Nov 20 '15 at 20:15
• it's a well known issue. blogs.msdn.com/b/cjacks/archive/2007/02/19/… And disabling UAC is not the way to go. Basically, if "net use" works, GPP should work - they are same regarding to how they map drives. – strongline Nov 23 '15 at 20:20