473,800 Members | 2,741 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Searching against ActiveDirectory using System.Director yServices

I have been working on a project to search for 250,000 different
records in ActiveDirectory . The process takes a long time and I have
tried everything to make it faster. Currently using
System.Director yServices, the calls to the server to search for one
record is currently taking 2-3 seconds. I tried to throw these
requests in the ThreadPool, but was having locking issues on the call
to:

DirectorySearch er.FindOne();

Recently I discovered that the new System.Director yServices.Proto cols
in .NET 2.0 is Thread Safe. I rewrote all my code and was surprised
to see that a call to:

LDAPConnection. SendRequest(req uest);

takes 30-60 seconds. Ten times as long as the old way. What am I
missing? Here is the psuedocode showing how I am searching.
Obviously, I'm no expert in searching against ActiveDirectory , but am
trying my best to find good info on the subject.

string target = "dc=region, dc=server, dc=com";

LdapConnection connection = new LdapConnection( server);

string[] attributes = new string[] { "a", "b", "c", "d" };
string filter = String.Format(" (&(objectCatego ry=person)
(objectClass=us er)(employeeID= {0}))", ID);

SearchRequest request = new SearchRequest(t arget, filter,
SearchScope.Sub tree, attributes);
request.SizeLim it = 1;

DateTime start = DateTime.Now;
SearchResponse response;

try
{
response =
(SearchResponse )connection.Sen dRequest(reques t);
}

Sep 14 '07 #1
0 1442

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

Similar topics

2
3708
by: bob | last post by:
Hi, Is this the right place to dicuss Visual Studio 2005 and .Net 2? I am try to implement a class (already using Windows Authentication) where I am given a user name and I return a list of groups to which the user is a member. In .Net 1.1, I can use the System.DirectoryServices.ActiveDirectory namespace; but what do I use in .Net 2?
1
5072
by: Prasad Karunakaran | last post by:
I am using the C# DirectoryEntry class to retrieve the Properties of an user object in the Active Directory. I need to get the First Name and Last Name as properties. I know it is not supported with the ADSI NT Provider and only supported in the LDAP Provider. So given an UserId (UID) how can I read the First Name and Last Name using LDAP Provider. If anybody can help me with a C# sample code it would of great help. Thanks in advance.
2
3921
by: JBrek | last post by:
Hi, How can i set the LogonHours to users, using System.DirectoryServices? I think I must create a byte array, but it doesn't work. Thanks in advance, JBrek
2
426
by: TK | last post by:
How can I show a list of OS users and groups in an ASP.NET page? Is there MSDN or SDK articles? please help. TK
0
1068
by: dhnriverside | last post by:
Hi guys I want to find out which of my ActiveDirectory users is logged on to a particular ActiveDirectory Computer. I can get what Computer a user is logged on to with Dns.Resolve(Request.ServerVariables).HostName; But I want to create a list of the computers on the network, with whos
8
6265
by: Sameh Ahmed | last post by:
Hello there I need to get a list of domain controllers to a domain I bind too using it's name rather than the DN. I am trying a query looking for objectClass=nTDSDSA but this returns 0 results I am using VB.net 2.0 any ideas? Here's my code Thanks in advance.
1
4941
by: sudhapadmas | last post by:
Hello netters, I was trying to create a virtual directory in IIS using the following code: System.EnterpriseServices.Internal.IISVirtualRoot vr = new System.EnterpriseServices.Internal.IISVirtualRoot();
0
1250
by: killbill | last post by:
Hi All, I want to retrieve certificates assigned to a specific ActiveDirectory User. How i can do that using DirectoryServices namespace or is there any other way. I have done other user management work using DirectoryServices, so i would preffer to do it using that namespace. Any insight about it ??? Thanks.
14
1854
by: Naraendirakumar R.R. | last post by:
I have a client in the healthcare industry who would prefer to store the connection string in a centralized location in their Active Directory repository. Has anybody done this? What has your experience been? Are there any stock components in ASP.NET or 3rd party that would make this easy? Thank you for the info.
0
9550
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
10501
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...
0
10273
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
10250
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
7574
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
6811
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2944
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.