• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2528
  • Last Modified:

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\shtclogon.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.Network")
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.Dictionary")
    objGroupList.CompareMode = vbTextCompare
    For Each objGroup In objUser.Groups
      objGroupList(objGroup.sAMAccountName) = True
    Next
  End If
  IsMember = objGroupList.Exists(strGroup)
End Function

If IsMember("testgroup") Then
objNetwork.MapNetworkDrive "t:", "\\shtc.ad\shtc\data"
objNetwork.AddWindowsPrinterConnection "\\swanprint\Adm$Color"
End If

If IsMember("testgroup2") Then
objNetwork.MapNetworkDrive "q:", "\\shtc.ad\shtc\data\accounting"
End If

How can I get this to work? Thanks.

0
sjwall
Asked:
sjwall
  • 2
1 Solution
 
sirbountyCommented:
Line 26 appears to be
objNetwork.MapNetworkDrive "q:", "\\shtc.ad\shtc\data\accounting"

Do the non-admins have right to that share?
0
 
jsvorCommented:
Are non admins able to access \\shtc.ad\shtc\data\accounting?
0
 
sjwallAuthor Commented:
Thanks for the pointer....forgot to check the basics!
0
 
sirbountyCommented:
Happy to help - thanx for the grade! :^)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now