sjwall
asked on
VBS logon script mapped drives error
Windows 2003 Server SP1
Windows XP Pro SP 2
WSH 5.6
I'm having a problem getting logon scripts to run for non-admins. If I logon to the machine as an admin, scripts works fine. I get the following error as non-admin:
Windows Script Host
Script \\shdc02\netlogon\shtclogo n.vbs
Line 26
Char 1
Error: Access is denied
Code 80070005
Source WSHNetwork.MapNetworkDrive
Logon Script:
Dim objGroupList, objNetwork, objSysInfo, strUserDN, objUser
Set objNetwork = CreateObject("Wscript.Netw ork")
Set objSysInfo = CreateObject("ADSystemInfo ")
strUserDN = objSysInfo.userName
Set objUser = GetObject("LDAP://" & strUserDN)
Function IsMember(strGroup)
Dim objGroup
If IsEmpty(objGroupList) Then
Set objGroupList = CreateObject("Scripting.Di ctionary")
objGroupList.CompareMode = vbTextCompare
For Each objGroup In objUser.Groups
objGroupList(objGroup.sAMA ccountName ) = True
Next
End If
IsMember = objGroupList.Exists(strGro up)
End Function
If IsMember("testgroup") Then
objNetwork.MapNetworkDrive "t:", "\\shtc.ad\shtc\data"
objNetwork.AddWindowsPrint erConnecti on "\\swanprint\Adm$Color"
End If
If IsMember("testgroup2") Then
objNetwork.MapNetworkDrive "q:", "\\shtc.ad\shtc\data\accou nting"
End If
How can I get this to work? Thanks.
Windows XP Pro SP 2
WSH 5.6
I'm having a problem getting logon scripts to run for non-admins. If I logon to the machine as an admin, scripts works fine. I get the following error as non-admin:
Windows Script Host
Script \\shdc02\netlogon\shtclogo
Line 26
Char 1
Error: Access is denied
Code 80070005
Source WSHNetwork.MapNetworkDrive
Logon Script:
Dim objGroupList, objNetwork, objSysInfo, strUserDN, objUser
Set objNetwork = CreateObject("Wscript.Netw
Set objSysInfo = CreateObject("ADSystemInfo
strUserDN = objSysInfo.userName
Set objUser = GetObject("LDAP://" & strUserDN)
Function IsMember(strGroup)
Dim objGroup
If IsEmpty(objGroupList) Then
Set objGroupList = CreateObject("Scripting.Di
objGroupList.CompareMode = vbTextCompare
For Each objGroup In objUser.Groups
objGroupList(objGroup.sAMA
Next
End If
IsMember = objGroupList.Exists(strGro
End Function
If IsMember("testgroup") Then
objNetwork.MapNetworkDrive
objNetwork.AddWindowsPrint
End If
If IsMember("testgroup2") Then
objNetwork.MapNetworkDrive
End If
How can I get this to work? Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are non admins able to access \\shtc.ad\shtc\data\accoun ting?
ASKER
Thanks for the pointer....forgot to check the basics!
Happy to help - thanx for the grade! :^)