Could someone please provide some assistance with VBS scripting?
Here is what I have modified so far;
Const GROUP1 = "cn=GROUP1"
Const GROUP2 = "cn=GROUP2"
Const GROUP3 = "cn=GROUP3"
Set wshNetwork = CreateObject("WScript.Network")
Set ObjectUser = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ObjectUser.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))
If InStr(strGroups, LCase("GROUP1")) Then
wshNetwork.MapNetworkDrive "L:", "\\servername\\volume1\"
End If
If InStr(strGroups, LCase("GROUP2")) Then
wshNetwork.MapNetworkDrive "M:", "\\servername\volume2\"
End If
If InStr(strGroups, LCase("GROUP3")) Then
wshNetwork.MapNetworkDrive "N:", "\\servername\volume3\"
End If
I am unsure of how best and easiest way to retreive LDAP string? I also keep getting an error on Set CurrentUser = GetObject("LDAP://" & ObjectUser.UserName)
.
Any help would be much appreciated.