SELECT * FROM OpenQuery (
ADSI,
'SELECT displayName, telephoneNumber, mail, mobile, facsimileTelephoneNumber
FROM ''LDAP://XXXXX/DC=XXXXX,DC=local''
WHERE objectClass = ''User'' and memberOf = ''CN=MyGroup,OU=PermissionGroups,OU=IT grupp,OU=Groups,OU=itgroup,DC=XXXX,DC=local''
') AS tblADSI
ORDER BY displayname
This call should give me 12 users, but only gives me 6. Now I was scratching my head trying to find out why, when I noticed the 6 users I did not get, had this 'itgroup' set as primary Group. The second I pick another Group as primary Group I get them back using this call.
Why is that? That's a problem, what can I do about it? And should it even be like this?