Advertisement
Guest User

Untitled

a guest
Mar 25th, 2010
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function IsMember(ByVal objADObject, ByVal strGroup)
  2.     ' Function to test for group membership.
  3.     ' objGroupList is a dictionary object with global scope.
  4.    
  5.     ' "Everyone" is a pseudo-group that should always return True
  6.     If (LCase(strGroup) = "everyone") Then
  7.         IsMember = True
  8.     Else ' Otherwise do a proper check
  9.         If (IsEmpty(objGroupList) = True) Then
  10.         Set objGroupList = CreateObject("Scripting.Dictionary")
  11.         End If
  12.         If (objGroupList.Exists(objADObject.sAMAccountName & "\") = False) Then
  13.         Call LoadGroups(objADObject, objADObject)
  14.         objGroupList.Add objADObject.sAMAccountName & "\", True
  15.         End If
  16.         IsMember = objGroupList.Exists(objADObject.sAMAccountName & "\" _
  17.         & strGroup)
  18.     End If
  19. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement