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
5 6865 iburyak 1,017
Recognized Expert Top Contributor
1. Execute line below on your SQL Server to link server and AD:
[PHP]EXEC sp_addlinkedser ver '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.
1. Execute line below on your SQL Server to link server and AD:
[PHP]EXEC sp_addlinkedser ver '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?
1. Execute line below on your SQL Server to link server and AD:
[PHP]EXEC sp_addlinkedser ver '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.
I have a similar script. Can you tell me how to pull more than 1000 records at a time?
I am also running into the 1000 row limitation. Can you please provide the workaround?
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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'
|
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 problem is I get the
following two errors everytime I try to create the application:
Error 1:
The web was created successfully, but an error occured trying to
configure the application root of this web.Web projects may not
operate correctly...
|
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 Windows authentication. The error
occurs on the FindAll method. The exceptions are as follows. anyway of
getting the code working with Integrated Windows authentication (too annoying
for user to enter user-name/password). Note I do need to use...
|
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:
| |
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 access to the active directory but when i
search for some users into the active directory, it returns none though
there are more then 42 users exists.
the code has been tested with Desktop Application locally. it is
|
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
|
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
role within Active directory.
For example, Region1 has 4 sites, Region 2 has 3 sites and so forth.
All the sites are held in a single database table.
|
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 there. I've just bought a new server runing server 2008. I would like to move the active directory, just the active directory to the server 08 machine.
I'm not opposed to re-doing the schema because it is somewhat a mess, but all I know is I...
|
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...
|
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...
| |
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...
|
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,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
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...
| |