List of users in specific Active Directory Distribution Group

前端 未结 2 1782
遇见更好的自我
遇见更好的自我 2021-01-05 08:45

I\'m trying to get a list of users and some properties about the user from within an active directory group.

Update:

Here are the two method

2条回答
  •  走了就别回头了
    2021-01-05 09:14

    Scope your search wider, wherever the members may be:

    Dim directoryEntry As New DirectoryEntry("LDAP://OU=All,DC=Domain,DC=com")
    

    Filter based on group membership:

    directorySearcher.Filter = "(&(objectCategory=person)" & _
                                 "(objectClass=user)" & _
                                 "(memberOf=CN=MyGroup,OU=Groups,OU=All,DC=Domain,DC=com))"
    

提交回复
热议问题