locked
Accessing active directory RRS feed

  • Question

  • hai all,
    i want access active directory to check some user for authentication. Im using windows authentication for my project.
    i can access the active directory and check the valid users in windows XP with this piece of code.

            DirectorySearcher search = new DirectorySearcher();
            search.Filter = String.Format("(SAMAccountName={0})", loginName);
            search.PropertiesToLoad.Add("cn");
            SearchResult result = search.FindOne();

            if (result == null)
            {
                return false;
            }
            else
            {
                return true;
            }

    but the problem is when i run the code in windows server 2003 or after deploying the solution in windows server i cant access the active directory. im receiving COM Exception.i think it may be configuration problem. its working fine with local IIS configuration.But its not working in server.. can anyone help me out for this problem. i have delivery on next ween. so kindly reply me ASAP
    Friday, October 17, 2008 4:43 AM

Answers

All replies