473,418 Members | 2,087 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

SQL Server 2000 & Active Directory: Problems querying

Hello --

I'm trying to get SQL Server 2000 on a Windows 2000 Server to be able
to query an Active Directory. We've got two domain servers one Win2000
and one Win2003. However, I'm having problems:

I've run the following query to setup the linked server:

sp_addlinkedserver 'ADSI', 'Active Directory Service Interfaces',
'ADSDSOObject', 'adsdatasource'

Using Enterprise Manager I've changed the login details for the ADSI
linked server to:

Be made using the following security context:
Username: MyDomain\Administrator
Password: ****

I've then tried to run the following query in Query Analyzer:

SELECT * FROM
OpenQuery(
ADSI,
'<LDAP://CN=Users,DC=MyDomain,DC=com>;(&(objectCategory=Per son)(objectClass=User));name,adspath'
)

But get the following error message:
Could not execute query against OLE DB provider 'ADSDSOObject'.

Does anyone have any ideas on what this message means or how to get
this working?

Thanks

--
James Allan
james [at] allan-home.co.uk
Jul 20 '05 #1
2 15171
"James Allan" <ja***@allan-home.co.uk> wrote in message
news:2f*************************@posting.google.co m...
Hello --

I'm trying to get SQL Server 2000 on a Windows 2000 Server to be able
to query an Active Directory. We've got two domain servers one Win2000
and one Win2003. However, I'm having problems:

I've run the following query to setup the linked server:

sp_addlinkedserver 'ADSI', 'Active Directory Service Interfaces',
'ADSDSOObject', 'adsdatasource'

Using Enterprise Manager I've changed the login details for the ADSI
linked server to:

Be made using the following security context:
Username: MyDomain\Administrator
Password: ****

I've then tried to run the following query in Query Analyzer:

SELECT * FROM
OpenQuery(
ADSI,
'<LDAP://CN=Users,DC=MyDomain,DC=com>;(&(objectCategory=Per son)(objectClass=
User));name,adspath' )

But get the following error message:
Could not execute query against OLE DB provider 'ADSDSOObject'.

Does anyone have any ideas on what this message means or how to get
this working?

Thanks

--
James Allan
james [at] allan-home.co.uk


From searching on Google, it seems some people have managed to get this to
work. However, this posting from an MS engineer seems to indicate that the
provider isn't supported in SQL Server:

http://groups.google.com/groups?hl=e...40cpmsftngxa06

Simon

Jul 20 '05 #2
You might try changing your LDAP query just a little, the linked server
syntax is fine.

SELECT [Name],SN[Last Name]
FROM OPENQUERY( ADSI,
'SELECT Name,SN FROM ''LDAP://servername.domainname.com/CN=Users,
DC=domainname,DC=com''
WHERE objectCategory = ''Person'' AND objectClass = ''user'' order by
name')

This is pulling from a container called users, only the class and
category of user. If you have users in seperate OU's you would specify
them by 'OU='

NOTE: I changed the DNS info, you will have to input yours.

HTH

Ray Higdon MCSE, MCDBA, CCNA

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: FloridaJoe | last post by:
Thanking everyone in advance, I have been an AS400 RPG programmer for many years - moving into visual studio. I have both visual studio 6 and .net, but far more experience with 6. I would like...
6
by: Alan | last post by:
I'm just about to start a project that needs to combine the results of a SQL Server query with the results of an Index Server query. The basic idea is that the user enters/selects a bunch of search...
2
by: Jay Chan | last post by:
We have just installed a SQL Server 2000 (SP 3A) onto a computer that has Windows-2003 Server on it. Now, we cannot get access to that database server from other computers. Seem like this may be an...
1
by: Michael | last post by:
Some of our developers are having a problem making certain code work that reads the contents of OUs in our Active Directory. It reads fine when querying a 2000 domain controller but when accessing...
2
by: Kevin R | last post by:
I'm trying to get asp.net 1.1 running on my home PC. When I try creating a new ASP.NET Web Application in 'Visual Studio .NET 2003' I get the following error: "Visual Studio .NET has detected...
62
by: Bryan Dickerson | last post by:
Is there a way, with VS 2005 and FX 2.0, to read a given inbox? I need to write a 'monitor' program and my boss is convinced, as is always his first gut reaction, that we need to go buy a...
1
by: Pradeep | last post by:
Hi, I have pounded my head for the last couple of hours tyring ot figure out on how to make my query using LDAP to the AD. The code works fine on XP. And also works great in a windows application....
3
by: Lucky | last post by:
Hi guys, after long long time. i'm back again with another problem. this time i think the problem is very very interesting and i really need you help on this. i'm trying to connect to the...
3
by: MuZZy | last post by:
Hi, I'm trying to find a way to call a standard ActiveDirectory search dialog from my C# app, so i can pick a domain or computer user an dreturn it to the app. It's a search like one showing...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.