The problem happens when we try to set the password for two different users
with DirectoryEntry.Invoke method.
The first time we use user.Invoke("SetPassword",new object[] {pwdUsuario});
it works fine!! but when we repeat the same code for the second user it
throws an exception:
mscorlib: System.Reflection.TargetInvocationException: Exception has been
thrown by the target of an invocation
This doesn´t happen if we close the aplication every time we execute the
DirectoryEntry.Invoke method!!
Thanks in advance
Example code:
System.DirectoryServices.DirectoryEntry user= DirectoryEntry (cadLDAP)
user.Invoke("SetPassword",new object[] {pwdUsuario});
user.CommitChanges();
user.Close();
user.Dispose();
----------------------------------------------------------------------------
-----------------------------------------------