473,785 Members | 2,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DirectorySearch er - whats wrong with this?!

Hi

I'm getting the following error in my code...

"Exception Details: System.Runtime. InteropServices .COMException: The server
does not support the requested critical extension"

Here's the function...
int listc;
string cs;
DirectoryEntry entry = new DirectoryEntry( "LDAP://" +
ConfigurationSe ttings.AppSetti ngs.Get("System _ActiveDirPath" ));
DirectorySearch er mySearcher = new DirectorySearch er(entry);
mySearcher.Filt er = ("(objectClass= user)");
mySearcher.Sort = new SortOption("Fir stName", SortDirection.A scending);
listc = 1;
foreach(SearchR esult resEnt in mySearcher.Find All())
{
try
{
DirectoryEntry de = resEnt.GetDirec toryEntry();
if((de.Properti es["DisplayNam e"].Value != null) &&
(de.Properties["givenName"].Value != null) && (de.Properties["sn"].Value !=
null))
{
ListItem adItem = new ListItem();
adItem.Text = de.Properties["givenName"].Value.ToString () + " " +
de.Properties["sn"].Value.ToString ();
adItem.Value = de.Properties["sAMaccountname "].Value.ToString ();
ddlDartsContact .Items.Insert(l istc, adItem);
adItem = null;
listc++;
}
}
finally {}

I *think* the problem is to do with the line

mySearcher.Sort = new SortOption("Fir stName", SortDirection.A scending);

Any help/ideas as to what's wrong appreciated!

Cheers
Dan

Nov 19 '05 #1
2 3331
Hi Dan:

I know there is some sort operations that can cause this error (see
http://support.microsoft.com/?kbid=842637). As the article suggests -
you could sort the entries client side.

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Mon, 21 Mar 2005 03:35:05 -0800, dhnriverside <da*@musoswire. com>
wrote:
Hi

I'm getting the following error in my code...

"Exception Details: System.Runtime. InteropServices .COMException: The server
does not support the requested critical extension"

Here's the function...
int listc;
string cs;
DirectoryEnt ry entry = new DirectoryEntry( "LDAP://" +
ConfigurationS ettings.AppSett ings.Get("Syste m_ActiveDirPath "));
DirectorySearc her mySearcher = new DirectorySearch er(entry);
mySearcher.Fil ter = ("(objectClass= user)");
mySearcher.Sor t = new SortOption("Fir stName", SortDirection.A scending);
listc = 1;
foreach(Search Result resEnt in mySearcher.Find All())
{
try
{
DirectoryEnt ry de = resEnt.GetDirec toryEntry();
if((de.Propert ies["DisplayNam e"].Value != null) &&
(de.Properti es["givenName"].Value != null) && (de.Properties["sn"].Value !=
null))
{
ListItem adItem = new ListItem();
adItem.Text = de.Properties["givenName"].Value.ToString () + " " +
de.Propertie s["sn"].Value.ToString ();
adItem.Value = de.Properties["sAMaccountname "].Value.ToString ();
ddlDartsContac t.Items.Insert( listc, adItem);
adItem = null;
listc++;
}
}
finally {}

I *think* the problem is to do with the line

mySearcher.Sor t = new SortOption("Fir stName", SortDirection.A scending);

Any help/ideas as to what's wrong appreciated!

Cheers
Dan


Nov 19 '05 #2
Are you sure that there is an attribute called FirstName in the user class?
It is usually called givenName

"dhnriversi de" <da*@musoswire. com> wrote in message
news:71******** *************** ***********@mic rosoft.com...
Hi

I'm getting the following error in my code...

"Exception Details: System.Runtime. InteropServices .COMException: The server does not support the requested critical extension"

Here's the function...
int listc;
string cs;
DirectoryEntry entry = new DirectoryEntry( "LDAP://" +
ConfigurationSe ttings.AppSetti ngs.Get("System _ActiveDirPath" ));
DirectorySearch er mySearcher = new DirectorySearch er(entry);
mySearcher.Filt er = ("(objectClass= user)");
mySearcher.Sort = new SortOption("Fir stName", SortDirection.A scending);
listc = 1;
foreach(SearchR esult resEnt in mySearcher.Find All())
{
try
{
DirectoryEntry de = resEnt.GetDirec toryEntry();
if((de.Properti es["DisplayNam e"].Value != null) &&
(de.Properties["givenName"].Value != null) && (de.Properties["sn"].Value != null))
{
ListItem adItem = new ListItem();
adItem.Text = de.Properties["givenName"].Value.ToString () + " " +
de.Properties["sn"].Value.ToString ();
adItem.Value = de.Properties["sAMaccountname "].Value.ToString ();
ddlDartsContact .Items.Insert(l istc, adItem);
adItem = null;
listc++;
}
}
finally {}

I *think* the problem is to do with the line

mySearcher.Sort = new SortOption("Fir stName", SortDirection.A scending);

Any help/ideas as to what's wrong appreciated!

Cheers
Dan

Nov 19 '05 #3

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

Similar topics

0
356
by: jeje91 | last post by:
I need to get a directoryentry associated to a samaccountname. It works in most cases, except when there are special characters in the samaccountname. In the present case, a user has a '(' char in its samaccoutname so i escaped this char to test, but even if I don't have anymore a syntax error, the findone method return null so I wonder whats wrong. anyway, - does anybody know another way to do it? - Is there is a method in .net to...
4
8225
by: cameron | last post by:
I have always been under the impression that LDAP was optimized for speed. Fast queries, fast access, slower writes. I have a block of data in LDAP and in SQL. Exact same data. The query is fast but the first access to the result set takes longer that to do the query in SQL and process the sql results. From my trace.axd LDAP Test Starting Search 0.000112 0.000043 LDAP Test Done Search 0.003821 0.003374 <--- fast query at .003 sec LDAP...
0
1176
by: jeje91 | last post by:
I need to get a directoryentry associated to a samaccountname. It works in most cases, except when there are special characters in the samaccountname. In the present case, a user has a '(' char in its samaccoutname so i escaped this char to test, but even if I don't have anymore a syntax error, the findone method return null so I wonder whats wrong. anyway, - does anybody know another way to do it? - Is there is a method in .net to...
2
26877
by: Jim in Arizona | last post by:
I'm trying to do a check to see if a specific active directory user account exists in active directory AND a specific group. I can't seem to get the filter down right. I can do this to find a matching name in active directory: ================================================ Dim oroot As DirectoryEntry = New DirectoryEntry("LDAP://my.domain.local") Dim osearcher As DirectorySearcher = New DirectorySearcher(oroot) Dim oresult As...
0
10329
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
10152
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...
0
9950
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...
1
7500
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
6740
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
5381
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...
1
4053
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
3650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
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.