When debugging the print out of strGroup is always
"cn=owners,cn=users,dn=domain,dn=com"
and OWNERS_GROUP is always "cn=users"
I can't figure out why I can't match OWNERS_GROUP to part of the string
in strGroups...
TIA
Dim objNetwork, objUser, CurrentUser, strGroup, GroupList, colGroups
Dim OWNERS_GROUP, STAFF_GROUP
OWNERS_GROUP = "cn=owners"
STAFF_GROUP = "cn=staff"
Set objUser = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & objUser.UserName)
colGroups = CurrentUser.memberOf
If IsEmpty(colGroups) Then
strGroups = ""
ElseIf TypeName(colGroups) = "String" Then
strGroups = LCase(colGroups)
Else
strGroups = LCases(Join(colGroups))
End If
'WScript.Echo " Groups: "& strGroups
'WScript.Echo " Groups Str: "& OWNERS_GROUP
'GroupList = "" & CurrentUser.MemberOf
'Response.Write GroupList
'strGroups = LCase(Join(GroupList))
pos=InStrRev(strGroup, OWNERS_GROUP)
WScript.Echo " Pos: "& pos
' Extra code just to add a message box
'WScript.Echo " Launch Explorer, check: "& strDriveLetter
If InStrRev(strGroup, STAFF_GROUP) Then
wshNetwork.MapNetworkDrive "s:", "\\server\public"
ElseIf InStrRev(strGroup, OWNERS_GROUP) Then
wshNetwork.MapNetworkDrive "o:", "\\server\private"
wshNetwork.MapNetworkDrive "s:", "\\server\public"
End If