I have a vbs script that I'm trying to run for users of a new Windows 2003 Server R2 Active Directory.
I keep getting a MS VBScript compilation error
Line 13 Char 33 Syntax error 800A03EA
I am by no means a programmer and am having one heck of a time figuring this out.
Can someone here give me a hand?? It is only mapping user home drives, a couple of network drives, then group drives.
Something I will say is that we are a very small company (50ppl) so I do not have any OUs all security groups are global domain groups (I know....shouldn't but...)
Code:
' Initialise Groups with Const
Const Accounting_GROUP = "cn=Accounting"
Const FIELD_GROUP = "cn=Field"
Const LAB_GROUP = "cn=Lab"
Const OPS_GROUP = "cn=Ops"
Const SALES_GROUP = "cn=Sales"
Const MGMT_GROUP = "cn=Managers"
Const USERS_GROUP = "cn=Users"
Const MAS90_GROUP = "cn=MAS90"
Const LIMS_GROUP = "cn=LIMS System"
Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "h:",
"\\emt.local\dfs\userhome\" & wshNetwork.UserName
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" &
ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))
If InStr(strGroups, MAS90_GROUP) Then
wshNetwork.MapNetworkDrive "m:",
"\\emt.local\dfs\Accounting\mas90"
If InStr(strGroups, LIMS_GROUP) Then
wshNetwork.MapNetworkDrive "o:",
"\\emt.local\dfs\omega\"
If InStr(strGroups, ACCOUNTING_GROUP) Then
wshNetwork.MapNetworkDrive "g:",
"\\emt.local\dfs\groups\Accounting\"
ElseIf InStr(strGroups, FIELD_GROUP) Then
wshNetwork.MapNetworkDrive "g:",
"\\emt.local\dfs\groups\field\"
ElseIf InStr(strGroups, LAB_GROUP) Then
wshNetwork.MapNetworkDrive "g:",
"\\emt.local\dfs\groups\lab\"
ElseIf InStr(strGroups, OPS_GROUP) Then
wshNetwork.MapNetworkDrive "g:",
"\\emt.local\dfs\groups\ops\"
ElseIf InStr(strGroups, SALES_GROUP) Then
wshNetwork.MapNetworkDrive "g:",
"\\emt.local\dfs\groups\sales\"
ElseIf InStr(strGroups, MGMT_GROUP) Then
wshNetwork.MapNetworkDrive "g:",
"\\emt.local\dfs\groups\"
End If