List AD groups through a query

1

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

The structure, for neighbors to understand better: a group is created where a view is bound, for that group of the view another group is created, which are the users that 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.

    
asked by anonymous 21.01.2016 / 14:37

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 you need to be aware of the structure in Active Directory. OR is used to indicate the folder, and you must put all folder names to the destination. Each OU refers to a folder.

    
25.01.2016 / 16:09