none
DirectoryEntry.Invoke("SetPassword", new object[] { password }); is giving error in ASP.NET application RRS feed

  • Question

  • DirectoryEntry.Invoke("SetPassword", new object[] { password }); is giving error in ASP.NET application, while it is working perfectly in Console Application. The App Pool Account is the admin of AD but still getting same problem.


    Ali Murtaza
    Sharepoint Developer and Administrator
    Please remember to click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

    Sunday, August 31, 2014 6:05 AM

Answers

  • This problem is solve by another way.

    using (var context = new PrincipalContext(ContextType.Domain, "DomainName", null, "UserName", "Password"))
                    {
                        using (var user = UserPrincipal.FindByIdentity(context, IdentityType.SamAccountName, "username"))
                        {
    
                                user.SetPassword("Password");
    
                        }
                    }


    Ali Murtaza
    Sharepoint Developer and Administrator
    Please remember to click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

    • Marked as answer by AliMurtaza Sunday, August 31, 2014 9:54 AM
    Sunday, August 31, 2014 9:54 AM