473,850 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_addlinkedser ver '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\Admini strator
Password: ****

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

SELECT * FROM
OpenQuery(
ADSI,
'<LDAP://CN=Users,DC=MyD omain,DC=com>;( &(objectCategor y=Person)(objec tClass=User));n ame,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 15194
"James Allan" <ja***@allan-home.co.uk> wrote in message
news:2f******** *************** **@posting.goog le.com...
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_addlinkedser ver '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\Admini strator
Password: ****

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

SELECT * FROM
OpenQuery(
ADSI,
'<LDAP://CN=Users,DC=MyD omain,DC=com>;( &(objectCategor y=Person)(objec tClass=
User));name,ads path' )

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.doma inname.com/CN=Users,
DC=domainname,D C=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
4004
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 to create a program that could access our active directory and display an up to date telephone list for the organization on client computers. Does anyone know where I may find an example of a program that will do this, or know the basics of how it...
6
4991
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 criteria on a form. Most of the criteria selected by the user will be used to select records from the database - standard WHERE clause stuff - but the user can also enter free-text that should be searched for in associated uploaded documents. The...
2
2133
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 issue with Active Directory. Our network consists of Windows-2000 Servers (SP 4) and Windows-2000 workstations and Windows-XP workstations. We also have SQL Server 2000 (SP2) in three Windows-2000 servers. All work fine. Recently, we get a...
1
1960
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 a 2003 server, it gets errors ranging from Item not found to "Unable to access directory services". The second I take the 2003 server offline, everything works fine again. I can't really give much code detail since i work on the network side...
2
2297
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 that the specified Web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services" Thanks for any help in advance. Kevin ===============================
62
3470
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 3rd-party package to just read an inbox. He may be right this time, but that's not usually my first gut reaction--we've had too many good employees around here fired 'cause they spent too much money on albatross software (another soapbox, sorry). I need...
1
1272
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. But on a web page, it just fails. I am sure its something to do with IIS settings on Win 2K3 server. But dont' know what. Would be really really thankful if someone can help me out here. thanks in advance. Pradeep
3
11319
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 Active Directory. for that i've added one linked server to connect to the active directory. and then query like this: adding linked server:
3
5797
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 when you call: rundll32 dsquery,OpenQueryWindow I'm sure there is a Win32 API method to do that but i can't find one.
0
9895
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9744
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10670
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10725
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7900
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5931
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4142
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.