I am trying to get the OU from AD using the following query:
SELECT * FROM OPENQUERY(ADSI,
'<LDAP://DC=test,DC=COM>;(&(objectCategory=Person)(objectClass=user)); ou, sAMAccountName, givenName, sn, name, PhysicalDeliveryOfficeName, homedirectory, telephoneNumber, department, mail,info, adspath;subtree')
The problem is that it returns null for all.
SELECT * FROM OPENQUERY(ADSI,
'<LDAP://DC=test,DC=COM>;(&(objectCategory=Person)(objectClass=user)); ou, sAMAccountName, givenName, sn, name, PhysicalDeliveryOfficeName, homedirectory, telephoneNumber, department, mail,info, adspath;subtree')
The problem is that it returns null for all.