ADSI linked server needed to run/connect as a network service account
" ... This was quite an old post. But I'll just confirm that the issue is probably due to the service account that MSSQLSERVER service runs under needs to have domain access to query ADSI. Use a domain account to run the service and you should be fine, see info here: http://www.codeproject.com/aspnet/LikeDataStores.asp ..."
Check that you have (sql) rights ...
Check entries in the hosts and lmhosts files
Currently working ADSI query
SELECT TOP 30 *
FROM OPENQUERY ( ADSI,
'SELECT givenName, SN, displayName, mail, sAMAccountName,Department, Division, EmployeeId
WHERE objectCategory = ''Person'' AND
objectClass = ''user''')
Fully Qualified Name