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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 sp_addlinkedsrvlogin
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Subhani
Starting Member

India
1 Posts

Posted - 03/21/2005 :  04:44:41  Show Profile  Reply with Quote
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

Directory.

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'

SELECT *
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].

  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000