Logon.vbs error

thenrich
thenrich used Ask the Experts™
on
I am trying to create a login script to map a network drive: Below is the code:
-----------------------------------------------------------
Const ENGINEERING_GROUP     = "cn=engineering"
Const FINANCE_GROUP         = "cn=finance"
Const HUMAN_RESOURCES_GROUP = "cn=human resources"
Set wshNetwork = CreateObject("WScript.Network")
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
Set WshNetwork = CreateObject("WScript.Network")
strGroups = LCase(Join(CurrentUser.MemberOf))
wshNetwork.MapNetworkDrive "E:","\\agradc2\Engineering"
-------------------------------------------------------------------------

The code looks ok but I keep getting the error "The network path was not found"

I have validated that this user does have permission to navigate to this folder.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Try running this script as the user and see if you get any errors... (basically the same thing but simplified without the AD commands).

If you get the same message, you'll know it's a connectivity issue to the server. If this one works, you'll know it's a problem with how you're setting up the AD information.
Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "E:", "\\agradc2\Engineering" 

Open in new window

Author

Commented:
It was a coonectivity issue

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial