473,735 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Querying Windows Active Directory from Sql Server 2000

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:

sp_addlinkedser ver 'ADSI', 'Active Directory Service Interfaces',
'ADSDSOObject', 'adsdatasource'
Query:
SELECT [Name],SN[Last Name]
FROM OPENQUERY( ADSI,
'SELECT Name,SN FROM ''LDAP://imsdom.dk/CN=Users,
DC=domainname,D C=com''
WHERE objectCategory = ''Person'' AND objectClass = ''user'' order by
name')

Error:
OLE DB provider 'ADSDSOObject' reported an error. The provider
indicates that the user did not have the permission to perform the
operation.
OLE DB error trace [OLE/DB Provider 'ADSDSOObject'
ICommandPrepare ::Prepare returned 0x80040e09: The provider indicates
that the user did not have the permission to perform the operation.].
i can't say anything more on this. as even i dont know about this. it
is just a R&D on for very important functionality. if someone has done
anything before like this, please do share with me.

Tools:

windows Active Directory
sql server 2000 sp4
VS.net 2005
thanks,
Lucky

Jul 4 '06 #1
3 11303
Stu
Hey Lucky,

I've never used ODBC to connect to ActiveDirectory before, but the
error indicates that it's a permissions problem. My guess is that the
SQL Server account (the account under shich SQL Server runs) does not
have permission to read the ActiveDirectory tree. Again, just
guessing, but you are probably running SQL Server as a local system
account, which wouldn't have any rights on the network.

Stu

Lucky wrote:
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:

sp_addlinkedser ver 'ADSI', 'Active Directory Service Interfaces',
'ADSDSOObject', 'adsdatasource'
Query:
SELECT [Name],SN[Last Name]
FROM OPENQUERY( ADSI,
'SELECT Name,SN FROM ''LDAP://imsdom.dk/CN=Users,
DC=domainname,D C=com''
WHERE objectCategory = ''Person'' AND objectClass = ''user'' order by
name')

Error:
OLE DB provider 'ADSDSOObject' reported an error. The provider
indicates that the user did not have the permission to perform the
operation.
OLE DB error trace [OLE/DB Provider 'ADSDSOObject'
ICommandPrepare ::Prepare returned 0x80040e09: The provider indicates
that the user did not have the permission to perform the operation.].
i can't say anything more on this. as even i dont know about this. it
is just a R&D on for very important functionality. if someone has done
anything before like this, please do share with me.

Tools:

windows Active Directory
sql server 2000 sp4
VS.net 2005
thanks,
Lucky
Jul 4 '06 #2
Hi Pal,
Thanks for your replay. yeah i'm running the SQL server locally but it
is added to the active directory and i've rights in active directory to
insert,delete,u pdate as well as i'm using the administrator(" sa")
account in SQL Server to run the query.

yeah, it seems the problem is with user permission but i don't know how
and where i need to correct them.

any idea on this?

Lucky

Stu wrote:
Hey Lucky,

I've never used ODBC to connect to ActiveDirectory before, but the
error indicates that it's a permissions problem. My guess is that the
SQL Server account (the account under shich SQL Server runs) does not
have permission to read the ActiveDirectory tree. Again, just
guessing, but you are probably running SQL Server as a local system
account, which wouldn't have any rights on the network.

Stu

Lucky wrote:
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:

sp_addlinkedser ver 'ADSI', 'Active Directory Service Interfaces',
'ADSDSOObject', 'adsdatasource'
Query:
SELECT [Name],SN[Last Name]
FROM OPENQUERY( ADSI,
'SELECT Name,SN FROM ''LDAP://imsdom.dk/CN=Users,
DC=domainname,D C=com''
WHERE objectCategory = ''Person'' AND objectClass = ''user'' order by
name')

Error:
OLE DB provider 'ADSDSOObject' reported an error. The provider
indicates that the user did not have the permission to perform the
operation.
OLE DB error trace [OLE/DB Provider 'ADSDSOObject'
ICommandPrepare ::Prepare returned 0x80040e09: The provider indicates
that the user did not have the permission to perform the operation.].
i can't say anything more on this. as even i dont know about this. it
is just a R&D on for very important functionality. if someone has done
anything before like this, please do share with me.

Tools:

windows Active Directory
sql server 2000 sp4
VS.net 2005
thanks,
Lucky
Jul 4 '06 #3
Lucky (tu************ @gmail.com) writes:
Thanks for your replay. yeah i'm running the SQL server locally but it
is added to the active directory and i've rights in active directory to
insert,delete,u pdate as well as i'm using the administrator(" sa")
account in SQL Server to run the query.

yeah, it seems the problem is with user permission but i don't know how
and where i need to correct them.

any idea on this?
I don't know much about Active Directory, but it appears to me that you
failed to understand Stu's reply.

Right-click My Computer, select Manage, find Service. In the list,
find the SQL Server service. Double-click and go to the Log on tab.
What does it say? If it says Local System, you are out of luck, because
Local System does not have network privileges. You need to specify a
domain account that has permissions in the AD.

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jul 4 '06 #4

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

Similar topics

0
4186
by: Lorenzo | last post by:
I'm trying to access to a LDAP server by a VB 6 application in order to get info about user. The following code works fine running on Windows 2000 professional but fails on Windows XP. Can anybody give me any information about this kind of conflict ?
2
15189
by: James Allan | last post by:
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'
5
3998
by: Joseph Barbaro | last post by:
I am trying to install DB2 Universal Database Enterprise Server Edition Version 8.1 (for Windows operating systems on 32-bit systems) on Windows 2000 Advanced Server that can be either standalone or part of a network. I am trying to avoid installing Active Directory and setting up the server as a domain controller. 1) Must DB2 UDB Enterprise be installed on a domain controller or can it be installed on W2K Advanced Server set up as a...
1
4754
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem I have run into I am not sure how to fix, and really not sure what is causing it. Here's what is going on (test server - Windows 2003 Server): I have a page in a folder (under anonymous authentication in IIS6) that has a link on it that...
10
4061
by: Hriday | last post by:
Hi there, Please help me..It is urgent This is Hriday, working on windows authentication with Active Directory... My requirment is when a user sends a request to my web Applicatoin I want to Pop up windows Authentication box so that user will give his userId, Password & domain name for authenticaion. After that I want to take these three info of user and make a search in Active Directory.
3
7488
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work on her local machine. Everything looks pretty good. OpenLDAP/cygwin works great. PostgreSQL works great. Apache runs. PHP runs. But when I try to connect to my PostgreSQL server using PHPPgAdmin, I
1
1266
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
0
388
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:
10
2104
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
I am trying to setup ASPNET account for .NET application to access database (SQL Server 2000) by aspnet_regiis -i in the directory C:\WINNT\Microsoft.NET\Framework\v1.1.4322 After running it, I got a successful installed information. But I can not find this account in Active Directory. The authentication uses Active Directory. David
0
8965
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
9466
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9255
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,...
0
9202
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8202
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4567
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4823
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3278
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
2741
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.