473,386 Members | 1,715 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,386 software developers and data experts.

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_addlinkedserver '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,DC=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 11251
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_addlinkedserver '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,DC=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,update 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_addlinkedserver '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,DC=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,update 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****@sommarskog.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
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...
2
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...
5
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...
1
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...
10
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...
3
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...
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....
0
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...
10
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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...

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.