Re: System.DirectoryServices - The server is not operational

From: George Durzi (gdurzi_at_hotmail.com)
Date: 12/15/04


Date: Wed, 15 Dec 2004 11:57:17 -0700

I can successfuly bind to Active Directory using the ldp.exe tool.
I can also successfuly locate my entry, this is the result shown in ldp.exe
window

***Searching...
ldap_search_s(ld, "CN=USERS,DC=CORP,DC=CompanyName,DC=COM", 1, "CN=GDURZI",
attrList, 0, &msg)
Result <0>: (null)
Matched DNs:
Getting 1 entries:
>> Dn: CN=gdurzi,CN=Users,DC=corp,DC=CompanyName,DC=com
 4> objectClass: top; person; organizationalPerson; user;
 1> cn: gdurzi;
 1> distinguishedName: CN=gdurzi,CN=Users,DC=corp,DC=CompanyName,DC=com;
 1> name: gdurzi;
 1> canonicalName: corp.CompanyName.com/Users/gdurzi;

Does this yield any clues?

"George Durzi" <gdurzi@hotmail.com> wrote in message
news:eS0Bp3s4EHA.2180@TK2MSFTNGP10.phx.gbl...
>I have an asp.net web application written in c# that uses Forms
>Authentication to authenticate against our Active Directory. I based the
>authentication code on the How To found on MSDN
>(http://support.microsoft.com/default.aspx?scid=kb;en-us;326340)
>
> The applications works just fine on our production servers. However, I'm
> installing it at one of our sister companies on a fresh W2K3 server box.
> They have just upgraded to Active Directory.
>
> I'm getting an Exception when I try to create a new DirectoryEntry to try
> and authenticate against AD.
> Exception Message: "The server is not operational"
> Source: "System.DirectoryServices"
>
> Before I go back to their admin and ask them to check into their install,
> I wanted to check on this board.
>
> Their domain is called: CORP.CompanyName.COM
> My LDAP connection string is
> LDAP://CORP.CompanyName.COM/DC=CORP,DC=CompanyName,DC=COM
>
> Here's my "IsAuthenticated" function
>
> string DomainUserName = Domain + @"\" + UserName;
> try
> {
> DirectoryEntry oDE = new DirectoryEntry(LDAPConnectString,
> DomainUserName, Password, AuthenticationTypes.Secure);
> Object oNativeObject = oDE.NativeObject;
> DirectorySearcher oDS = new DirectorySearcher(oDE);
> oDS.Filter = "(SAMAccountName=" + UserName + ")";
> oDS.PropertiesToLoad.Add("cn");
> SearchResult oSR = oDS.FindOne();
> if (null == oSR) return false;
> _path = oSR.Path;
> _filterattribute = (string)oSR.Properties["cn"][0];
> }
> catch (Exception oException)
> {
> return false;
> }
> return true;
>
> The exception happens right after the DirectoryEntry constructor. I don't
> think it's related to the oDE.NativeObject line, because if I try to
> enumerate the Children in my oDE object, I get the same error.
>
> So, it doesn't seem that the DirectoryEntry object is being created
> properly, although no exception is raised at that line.
>
> Thanks!
>



Relevant Pages

  • Re: System.DirectoryServices - The server is not operational
    ... you get this error if S.DS really can't contact the server. ... >>Authentication to authenticate against our Active Directory. ... >> I'm getting an Exception when I try to create a new DirectoryEntry to try ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: System.DirectoryServices - The server is not operational
    ... DirectoryEntry class doesn't bind to AD until you call a property or method ... you get this error if S.DS really can't contact the server. ... >Authentication to authenticate against our Active Directory. ... > I'm getting an Exception when I try to create a new DirectoryEntry to try ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: System.DirectoryServices questions
    ... The problem is how am I supposed to test whether a connection is active or not if I can create a DirectoryEntry with whatever data I want since the data really isn't verified until I try to use it? ... A connection is only established when you execute a method on that class, that binds to the directory service as part of it's implementation. ... And since my test environment is my PC connecting to an installation of Active Directory running within a virtual machine on my PC and my PC isn't a member of the domain I'm connecting to the Existsmethod will fail for me. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Passing security context to COM object
    ... If a Web application needs to access Active Directory, ... explicit credentials to the DirectoryEntry constructor in the ... Try supplying explicit credentials like this: DirectoryEntry entry = new ... | the security context of the logged-in user to ensure the user has the ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: System.DirectoryServices questions
    ... The problem is how am I supposed to test whether a connection is active or not if I can create a DirectoryEntry with whatever data I want since the data really isn't verified until I try to use it? ... A connection is only established when you execute a method on that class, that binds to the directory service as part of it's implementation. ... And since my test environment is my PC connecting to an installation of Active Directory running within a virtual machine on my PC and my PC isn't a member of the domain I'm connecting to the Existsmethod will fail for me. ...
    (microsoft.public.dotnet.languages.csharp)

Loading