B
Brian.ONeil
I have a class written in Visual Studio 2003 which runs a
"DirectorySearcher.FindOne" call, and it works well in 2003. In 2005, I
get an error "Invalid Operation" and not much more.
Anybody have remedy? Commiseration?
Code looks like (IS) the following :
public static bool AuthenticateUser(string UserName, string
Password, string ADPath)
{
DirectoryEntry entry = new DirectoryEntry(ADPath);
entry.Username = UserName;
entry.Password = Password;
try
{
DirectorySearcher search = new DirectorySearcher(entry);
search.Filter = "(cn=" + UserName + ")";
SearchResult result = search.FindOne();
if (null == result)
return false;
return true; }
catch
{ return false;
}
}
TIA
-Brian
"DirectorySearcher.FindOne" call, and it works well in 2003. In 2005, I
get an error "Invalid Operation" and not much more.
Anybody have remedy? Commiseration?
Code looks like (IS) the following :
public static bool AuthenticateUser(string UserName, string
Password, string ADPath)
{
DirectoryEntry entry = new DirectoryEntry(ADPath);
entry.Username = UserName;
entry.Password = Password;
try
{
DirectorySearcher search = new DirectorySearcher(entry);
search.Filter = "(cn=" + UserName + ")";
SearchResult result = search.FindOne();
if (null == result)
return false;
return true; }
catch
{ return false;
}
}
TIA
-Brian