locked
C# and Active Directory : problem with setPassword RRS feed

  • Question

  • User1318793020 posted

    Hello all,

    i have a problem when i will change a password of one user :


    string targetPath = "LDAP://ldap.truc.fr/CN=fictif,OU=UTILISATEURS,DC=truc,DC=fr";
    string admin = "truc_adm";
    string password_ldap = "truc_pass";
    DirectoryEntry adEntry = new DirectoryEntry(targetPath, admin, password_ldap,AuthenticationTypes.Secure);
    string password = "password";
    adEntry.Invoke("SetPassword", new object[] { password });
    adEntry.CommitChanges();


    I have a nice exception :

    Ex.Message "An exception was raised by the target of a call(appeal)."

    Please help me.


    Thanks.


    P.S : sorry for my english.

    Wednesday, July 29, 2009 5:16 AM

All replies

  • User-2009597737 posted

    Interesting error: never seen this before. Try

             object[] password = new object[] {password};
             object pwdReturn = usr.Invoke("SetPassword", password );


    Wednesday, July 29, 2009 2:52 PM
  • User1318793020 posted

    that's not work Frown

    Thursday, July 30, 2009 3:30 AM