473,466 Members | 1,332 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Pull info from Active Directory into SQL Server 2000

1 New Member
Hi,

I want to pull user info from Active Directroy into SQL Server 2000 table. I know that this is possible, but I don't know how. Can anyone help me.

Thnx Getseklets
Apr 1 '07 #1
5 6839
iburyak
1,017 Recognized Expert Top Contributor
1. Execute line below on your SQL Server to link server and AD:

[PHP]EXEC sp_addlinkedserver 'ADSI', 'Active Directory Service Interfaces', 'ADSDSOObject', 'adsdatasource'[/PHP]

2. Change From in query below. It is just an example you have to write your own query.

[PHP] SELECT * FROM OPENQUERY( ADSI,

'SELECT name, adsPath

FROM ''LDAP://DC=....,DC=....,DC=...,DC=com''

WHERE objectCategory = ''Person'' AND objectClass= ''user''')[/PHP]




Also you have to be aware that SQL query has limitation with AD.

1. It has a limit of 1000 records returned at a time. I have a work around if you'll really need it.

2. There is no way to return multiple results like group memberships (if you know what it is). Whenever AD tries to return an object it can not be done through SQL.


Thank you.
Apr 1 '07 #2
arshadsa
1 New Member
1. Execute line below on your SQL Server to link server and AD:

[PHP]EXEC sp_addlinkedserver 'ADSI', 'Active Directory Service Interfaces', 'ADSDSOObject', 'adsdatasource'[/PHP]

2. Change From in query below. It is just an example you have to write your own query.

[PHP] SELECT * FROM OPENQUERY( ADSI,

'SELECT name, adsPath

FROM ''LDAP://DC=....,DC=....,DC=...,DC=com''

WHERE objectCategory = ''Person'' AND objectClass= ''user''')[/PHP]




Also you have to be aware that SQL query has limitation with AD.

1. It has a limit of 1000 records returned at a time. I have a work around if you'll really need it.

2. There is no way to return multiple results like group memberships (if you know what it is). Whenever AD tries to return an object it can not be done through SQL.


Thank you.
What is that work around?
Oct 6 '07 #3
TorresI
1 New Member
1. Execute line below on your SQL Server to link server and AD:

[PHP]EXEC sp_addlinkedserver 'ADSI', 'Active Directory Service Interfaces', 'ADSDSOObject', 'adsdatasource'[/PHP]

2. Change From in query below. It is just an example you have to write your own query.

[PHP] SELECT * FROM OPENQUERY( ADSI,

'SELECT name, adsPath

FROM ''LDAP://DC=....,DC=....,DC=...,DC=com''

WHERE objectCategory = ''Person'' AND objectClass= ''user''')[/PHP]




Also you have to be aware that SQL query has limitation with AD.

1. It has a limit of 1000 records returned at a time. I have a work around if you'll really need it.

2. There is no way to return multiple results like group memberships (if you know what it is). Whenever AD tries to return an object it can not be done through SQL.


Thank you.
What is your work around for this. I'm trying to pull over 25000 rows from AD if it's possible.
Thanks.
Dec 14 '07 #4
krevell
1 New Member
I have a similar script. Can you tell me how to pull more than 1000 records at a time?
Jan 29 '08 #5
RaytheDBA
1 New Member
I am also running into the 1000 row limitation. Can you please provide the workaround?
Mar 27 '08 #6

Sign in to post your reply or Sign up for a free account.

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...
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...
0
by: Amol Shambharkar | last post by:
Hello Everyone, I am hoping someone could help me out with this.I am using Visual Studio .NET 2003 to create a web application on a remote IIS 5.0 server using the File Share web access method.The...
9
by: Patrick | last post by:
I have an ASP.NET page that searches for someone in the corporate Active Directory. It had been working fine until recently when I changed from Basic Authentication on IIS6 back to Integrated...
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...
1
by: Lucky | last post by:
hi guys, after long long efforts i got access to the active directory for "Intigrated windows authentication". now i', suppose to get access the network resources. the problem is i'm getting...
0
by: markswart | last post by:
Pull Active Directory 2003 Info into outgoing Email I would Like to attach users in active directory 2003 information to there outgoing email Name Surname ect. Please Help Mark
1
by: Tim | last post by:
Folks, I have 3 loosely linked problems which I am would appreciate feedback on. 1). T-Sql and Active directory roles. We want to be able to control access to data within a table based on a...
0
by: scotter86 | last post by:
Hey everyone, I'm pretty sure this is a somewhat stupid question, but I don't wana run into any issues. I already have active directory setup on a machine runing server 2000, exchange is also on...
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
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,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.