K
Kenneth Keeley
Hi,
I have been working on a Login page that uses ADSI to authenicate the
users. I had this all working on my test system and on a second system
connected to the live domain. Now it will only work on my test system which
is a win2K Server running as a domain controller and web server. The second
system is a win2K workstation connected to the live win2K domain controller,
This computer was able to run the code in the past and now all I keep
getting is "Active Directory Client has not been installed on this
computer".
The code I am using looks like this.
try
{
// Create Active Directory Object.
DirectoryEntry AdsiEntry = new DirectoryEntry(_AdPath, _Domain + @"\" +
_AdminUserName, _AdminPassword);
// Create an Active Directory Search.
DirectorySearcher AdsiSearch = new DirectorySearcher(AdsiEntry);
// Find UserName in Active Directory.
AdsiSearch.Filter = "(SAMAccountName=" + UserName + ")";
AdsiSearch.PropertiesToLoad.Add("cn");
SearchResult Result = AdsiSearch.FindOne();
if(Result == null)
{
// UserName was not Found.
return false;
}
// Update FullName.
_UserName = UserName;
_UserPath = Result.Path;
The problem occurs at the "SearchResult Result = AdsiSearch.FindOne();" Line
of code. all the other lines seem to work fine.
Can somebody help.
Kenneth
I have been working on a Login page that uses ADSI to authenicate the
users. I had this all working on my test system and on a second system
connected to the live domain. Now it will only work on my test system which
is a win2K Server running as a domain controller and web server. The second
system is a win2K workstation connected to the live win2K domain controller,
This computer was able to run the code in the past and now all I keep
getting is "Active Directory Client has not been installed on this
computer".
The code I am using looks like this.
try
{
// Create Active Directory Object.
DirectoryEntry AdsiEntry = new DirectoryEntry(_AdPath, _Domain + @"\" +
_AdminUserName, _AdminPassword);
// Create an Active Directory Search.
DirectorySearcher AdsiSearch = new DirectorySearcher(AdsiEntry);
// Find UserName in Active Directory.
AdsiSearch.Filter = "(SAMAccountName=" + UserName + ")";
AdsiSearch.PropertiesToLoad.Add("cn");
SearchResult Result = AdsiSearch.FindOne();
if(Result == null)
{
// UserName was not Found.
return false;
}
// Update FullName.
_UserName = UserName;
_UserPath = Result.Path;
The problem occurs at the "SearchResult Result = AdsiSearch.FindOne();" Line
of code. all the other lines seem to work fine.
Can somebody help.
Kenneth