Active Directory Client has not been installed on this computer

Discussion in 'ASP .Net' started by Kenneth Keeley, Aug 30, 2004.

  1. 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
     
    Kenneth Keeley, Aug 30, 2004
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.