I get the error from the point I add mail IS NOT NULL.
I also tried mail != null
SELECT * FROM OpenQuery(ADSI, 'SELECT mail, title, displayName, sAMAccountName, givenName FROM ''LDAP://OU=test,OU=test,DC=test,DC=test'' where mail IS NOT NULL and objectClass = ''User''' )
SELECT * FROM OpenQuery(ADSI, 'SELECT mail, title, displayName, sAMAccountName, givenName FROM ''LDAP://OU=test,OU=test,DC=test,DC=test'' where mail IS NOT NULL and objectClass = ''User''' )
Hi lordplazikovbj5,
Please try below query:
SELECT * FROM OpenQuery(
ADSI, 'SELECT mail, title, displayName, sAMAccountName, givenName
FROM ''LDAP://OU=test,OU=test,DC=test,DC=test'' where objectClass = ''User''')
where mail IS NOT NULL
Thanks.
Please mark the replies as answers if they help or unmark if not.
Feedback to us
lordplazikov...
Member
195 Points
319 Posts
AD query
Feb 20, 2012 08:19 AM|LINK
What's wrong with this query?
I get the error from the point I add mail IS NOT NULL.
I also tried mail != null
SELECT * FROM OpenQuery(ADSI, 'SELECT mail, title, displayName, sAMAccountName, givenName FROM ''LDAP://OU=test,OU=test,DC=test,DC=test'' where mail IS NOT NULL and objectClass = ''User''' )
Chen Yu - MS...
All-Star
21584 Points
2493 Posts
Microsoft
Re: AD query
Feb 24, 2012 06:23 AM|LINK
Hi lordplazikovbj5,
Please try below query:
Thanks.
Feedback to us
Develop and promote your apps in Windows Store