G
George Durzi
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!
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!