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.