Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Site Related Forums
 Article Discussion

Author  Topic 

Starting Member

1 Post

Posted - 2005-03-21 : 04:44:41
I want to create a login through "sp_addlinkedsrvlogin" to the "ADSI"
linked server inorder to access Active Directory to fetch email addresses of

the users present in active directory.
I want to use my sql Login to execute the query to fetch details from Active


Can any one help me with the query that will let my sql login to access

Active Directory using distributed query.

I am getting the following error while executing the query

exec sp_addlinkedsrvlogin 'ADSI',false,'CTS\114944',
'CN=Administrator,OU=Sales, DC=actived,DC=CTS,DC=com', 'karthi_123'

FROM OPENQUERY( ADSI,'SELECT mail,Name,samaccountname FROM
''LDAP://ctsincocfaa'' where samaccountname=''114944''')

Error Message::
An error occurred while preparing a query for execution against OLE DB provider 'ADSDSOObject'.
OLE DB error trace [OLE/DB Provider 'ADSDSOObject',ICommandPrepare::Prepare returned 0x80040e14].


- Advertisement -