List AD groups via a query

Asked

Viewed 2,251 times

1

I’m looking for a direct query to Adctive Directory. I need to know which groups Views are linked, the same goes for users.

The structure, for you to understand better: is created a group where is linked a view, for this group of view is created another group, that are users who have access to view.

SELECT
       *
FROM OPENQUERY(ADSI,'<LDAP://DC=dominio,DC=com,DC=br>;(&(objectCategory=person)(objectClass=user));
     sn,
    sAMAccountName,
    displayName,
    mail,
    telephoneNumber,
    mobile,
    physicalDeliveryOfficeName,
    department,
    division;
    subtree')

Above is what I have, which returns me all AD users.

1 answer

1

I found the solution to my problem.

(&(objectClass=group)(memberOF=CN=NomeView,OU=NomedaPasta,DC=dominio,DC=com,DC=br)

Remembering that it is necessary to have knowledge of the structure in Active Directory. OR is used to specify the folder, and you must put all folder names to the destination. Each OR refers to a folder.

  • A doubt the folders defined with "OR" are the groups the user is inserted?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.