473,698 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DirectoryServic es error!

Hi all,

I encounter some problem in DirectoryServic es, could someone help me?

private void InitLoginUser()
{
DirectoryEntry objEntry = new DirectoryEntry( );
DirectorySearch er objSearcher = new DirectorySearch er();
SearchResult objResult;

try
{
objEntry.Path = "LDAP://dc=iec,dc=inven tec";

objSearcher.Sea rchRoot = objEntry;
objSearcher.Fil ter = "(sAMAccountNam e=*464*)";
objSearcher.Sea rchScope = SearchScope.Sub tree;
objSearcher.Pro pertiesToLoad.A dd("displayName ");
objResult = objSearcher.Fin dOne();
} // try
finally
{
} // finally
}

private void Page_Load(objec t sender, System.EventArg s e)
{
// ±N¨Ï¥ÎªÌµ{¦¡½X¸ m©ó¦¹¥Hªì©l¤Æºô *¶
if (!IsPostBack)
InitLoginUser() ;
}

But it always show error message as following:

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Runtime. InteropServices .COMException: The
specified domain either does not exist or could not be contacted

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[COMException (0x8007054b): The specified domain either does not exist or
could not be contacted]
System.Director yServices.Direc toryEntry.Bind( Boolean throwIfFail) +514
System.Director yServices.Direc toryEntry.Bind( ) +10
System.Director yServices.Direc toryEntry.get_A dsObject() +10
System.Director yServices.Direc torySearcher.Fi ndAll(Boolean
findMoreThanOne ) +199
System.Director yServices.Direc torySearcher.Fi ndOne() +31
MailTracking.We bForm1.InitLogi nUser() in
c:\inetpub\wwwr oot\mailtrackin g\default.aspx. cs:35
MailTracking.We bForm1.Page_Loa d(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\mailtrackin g\default.aspx. cs:46
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +29
System.Web.UI.P age.ProcessRequ estMain() +724
Anyway, thanks all!

Nov 17 '05 #1
1 1721
Hi,

you need to write the full domain name with DCs

For example if the domin name is microsoft.com it should be :

DC=microsoft,DC =com

Connect to computers in a domain. For example, "LDAP://CN=
computer-name, CN=Computers, DC= domain-controller1, DC=
domain-controller2,... ".

Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #2

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

Similar topics

0
2170
by: kovac | last post by:
The System.directoryservices.dll has an error, and this error was described in http://support.microsoft.com/default.aspx?scid=kb;en-us;839424 At the moment we have Framework version v1.0.3705 and I have remove System.directoryservices.dll from current Framework version v1.0.3705. In state of old version I load die new System.directoryservices.dll from the Framework version v1.1.4322. I work with the following function of Joe Kaplan...
1
7375
by: Jason Gleason | last post by:
I am using the following method in a web service that utilizes the system.directoryservices namespace: public ArrayList GetAllAppPools(){ System.DirectoryServices.DirectoryEntry apppools = new DirectoryEntry("IIS://webserver/W3SVC/AppPools"); ArrayList appPoolNames = new ArrayList(); foreach(DirectoryEntry de in apppools.Children) { appPoolNames.Add(de.Name);
1
16214
by: Gaab | last post by:
Hi Folks, After the weekend I wanted to start working on my c#/asp.net project, but when I tried to open it on my machine i got the following error: Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
9
2142
by: Günther Rühmann | last post by:
Hi, I´m not sure if i´m right int this group... My problem: I made a vb .net application that reads from AD via System.Directoryservices.Directoryentry. The appliocation enumerates group members. It works fine on W2k - machines. It works on a WinNT 4 - server, too, but it stops with a runtime error on any Windows 4.0 Workstation. The error is: System.Runtime.InteropServices.COMException 0x800500F. at...
2
5456
by: Kelvin | last post by:
Hello I am using web matrix develop a login page through Active Directory but I cannot figure out why it is giving me an error when importing system.directoryServices. Any help will do! thank Compiler Error Message: BC30466: Namespace or type 'DirectoryServices' for the Imports 'System.DirectoryServices' cannot be found Line 2: Imports System.Tex Line 3: Imports System.Collection Line 4: Imports System.DirectoryService Line 5:
6
4082
by: Mark Rae | last post by:
Hi, I'm in the process of updating an ASP.NET v1.1 web app to v2. The app uses ActiveDirectory a great deal, and I'm trying to use the new System.Collections.Generic namespace where possible, having been advised by several luminaries that that is a "good thing to do"... :-) However, I'm experiencing a problem with the IEnumerable interface. (N.B. I understand fully that I should be using the LDAP provider instead of the WinNT provider...
6
5461
by: bugnthecode | last post by:
Hi, I'm building a small desktop app in VS Std 2005 with C# and .net 2.0. I've managed to get the code together to query the ldap my company has, but every time I attempt to access a specific property a COM Exception gets thrown, and I can't figure out why. This is a desktop app. example("ldap.example.com", "ou=People,dc=example,dc=com"); public void example(string server, string ou) { searcher = new DirectorySearcher(new...
6
2098
by: Bmack500 | last post by:
Hello, and Thanks in advance! Using: Vstudio 2005, XP, .NET 2.0 I'm getting the following error when running my code below. I'm passing an object array which contains other variables. It happens immediately when it hits the "For" loop: Unable to cast COM object of type 'System.__ComObject' to interface type 'IDirectorySearch'. This operation failed because the QueryInterface call on the COM component for the interface with IID
7
16325
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I am using this code to get groups for a user and getting a error (5) on the GetAuthorizationGroups() function . There are two domains. This function works on the local domain but does not work on the other domain. Other functions work on the other domain like get all the users and get all the groups and I can validate users on the other domain so I think I am communciating with the other domain OK just not with the...
0
8674
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, 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...
0
9157
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
9028
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
8895
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,...
0
8861
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...
0
7728
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
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
2330
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.