Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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:

share|improve this answer
    
+1 "too difficult for most people to handle" [chuckle] –  squillman Sep 9 '09 at 14:34
    
Thanks, I'm going to try your suggestion out tomorrow, looks like a winner! –  The_cobra666 Sep 9 '09 at 16:06
    
Welcome to UAC! Much as it's heart is in the right place, playing nicer in a Domain environment would have been a preferable approach (but that's another topic more appropriate to elsewhere). –  Darth Satan Sep 9 '09 at 17:02
1  
@squillman: >smile< It blows my mind that limited user accounts are still so "taboo". I've been putting Windows NT-based machines on desks with limited user accounts since Windows NT Workstation 4.0. It's not rocket scienece. You figure out what it takes to make your apps work (registry, file permissions, etc) and you make them work. If they absolutely won't work w/o "Administrtor" rights then you use RunAs and a dedicated account (thanks, W2K!) or you get a new app. Case closed. I can't understand why people can't just deal with it. This isn't new. –  Evan Anderson Sep 9 '09 at 17:56
    
@mh: We haven't had any problems with UAC, but then virtually no users at our Customer sites ever run as "Administrator", even in Vista. –  Evan Anderson Sep 9 '09 at 17:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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