Hello,
I am struggling with setting up a new logon.vbs. I have never had to create one from scratch, and even longer since I have had to write VB. I am able to only map one drive when I run the script and that is the drive specific to the user or what I call the "P:\" drive. I get no errors, but also no other drives mapped. I used the example provided from the Help topic on the domain conctroller. At this point, I am not worried about printers, so I am just trying to get drives mapped. Please see script below:
Const ENGINEERING_GROUP = "cn=AHCEngineering"
Const SALES_GROUP = "cn=AHCSales"
Const HUMAN_RESOURCES_GROUP = "cn=AHCHR"
Const IT_GROUP = "cn=ACHIT"
Const ACCOUNTING_GROUP = "cn=ACHAccounting"
Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "P:", "\\agph-admin\Private\" & wshNetwork.UserName
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))
If InStr(strGroups, ENGINEERING_GROUP) Then
wshNetwork.MapNetworkDrive "F:", "\\agph-admin\Engineering\"
ElseIf InStr(strGroups, SALES_GROUP) Then
wshNetwork.MapNetworkDrive "R:", "\\agph-admin\Sales\"
ElseIf InStr(strGroups, HUMAN_RESOURCES_GROUP) Then
wshNetwork.MapNetworkDrive "S:", "\\agph-admin\HR\"
ElseIf InStr(strGroups, IT_GROUP) Then
wshNetwork.MapNetworkDrive "I:", "\\adhdc1\IT\"
wshNetwork.MapNetworkDrive "F:", "\\agph-admin\Engineering\"
wshNetwork.MapNetworkDrive "S:", "\\agph-admin\HR\"
wshNetwork.MapNetworkDrive "T:", "\\agph-admin\Accounting\"
ElseIf InStr(strGroups, ACCOUNTING_GROUP) Then
wshNetwork.MapNetworkDrive "T:", "\\agph-admin\Accounting\"
End If
Thanks!
Dan