1

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
0

You might look into the Lookback GPO. If I recall, it needs to be enabled on the specific OU that contains the computer objects.

  • I don't see why lookback is related here. – strongline Nov 20 '15 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.