I am trying to get CASE to work with AND condition and maybe I just need to do IF THEN ELSE instead but here is what I am trying to accomplish or maybe I am missing something:
Run script User must be part of the groups to map the drive. Problem I am having is in a CASE where an end user is in multiple groups. I want a user to be EXACTLY in the groups specified NOT one or the other. If they are not in both groups then it doesn't need to map them.
On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = CreateObject("Wscript.Network")
strUserPath = "LDAP://" & objSysInfo.UserName
Set objUser = GetObject(strUserPath)
For Each strGroup in objUser.MemberOf
strGroupPath = "LDAP://" & strGroup
Set objGroup = GetObject(strGroupPath)
strGroupName = objGroup.CN
Select Case strGroupName
'Manufacturering Group
Case "Manufacturing Users"
objNetwork.MapNetworkDrive "p:", "\\data\share"
'Network Services user group
Case "Employees A-K"AND"ACL Admins"
objNetwork.MapNetworkDrive "I:", "\\data\share"
objNetwork.MapNetworkDrive "H:", "\\home\userdata\"
End Select
Next