...SELECT sAMAccountName, sn, givenName, LOWER(mail) AS mail
FROM openquery(ADSI,'<LDAP://cha-llp.com:389/DC=cha-llp,DC=com>;(sAMAccountName=*);sAMAccountName,sn,givenName,mail;subtree')
where sn is not null
order by sAMAccountName
[code]
But I get this error:
[code]
Server: Msg 7399, Level 16...