VBScript – Network Mapping Script Not Working on Vista

group-policyvbscriptwindows-server-2003windows-vista

I've got a weird problem, (like always :p )

Okay: Situation: Windows 2003 domain with XP clients. With a GPO I'm running a VBS script on login to map a few drives. This works great on XP, but not on Vista. If I manually run the script after the user has logged on, it works. So I know the script works on Vista, it just doesn't run via the GPO. The user has admin privileges.

I also have the same problem on Windows 7 RC1. So it must be related.

The script:

 on error resume next
Dim objNetwork
Dim strDriveLetter, strRemotePath, strUserName
strDriveLetter = "Z:"
strRemotePath = "\\Onsgeluk.ons_geluk.local\Profieldoc"
Set objNetwork = WScript.CreateObject("WScript.Network")
strUserName = objNetwork.UserName
objNetwork.RemoveNetworkDrive "Z:"
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath _
& "\" & strUserName
objNetwork.RemoveNetworkDrive "X:"
objNetwork.MapNetworkDrive "X:" , "\\Onsgeluk.ons_geluk.local\Data"
objNetwork.RemoveNetworkDrive "Y:"
objNetwork.MapNetworkDrive "Y:" , "\\Onsgeluk.ons_geluk.local\Mappen\hoofdverpleging"

Does anyone have a clue?

Thanks in advance guys (and girls)

ps: sorry for my bad english!

Best Answer

Your script is running fine.

Because your Vista users are Administrators and because you have User Account Control enabled the users' filtered token, under which Explorer runs, doesn't have access to the "drives" that were "mapped" when the logon script ran.

You have two choices: