F
Fabrizio
(Sorry for the crosspost, but I really don't know which is the right
newsgroup!)
Hi all,
I try to change the password to a user that as to change the password at
first logon:
try
{
DirectoryEntry de = new DirectoryEntry();
de.AuthenticationType = AuthenticationTypes.ServerBind |
AuthenticationTypes.Secure;
de.Path = "LDAP://10.0.50.20/cn=users,dc=newtesthp,dc=com";
de.Username = "cn=fv,cn=users,dc=newtesthp,dc=com";
de.Password = "fv";
DirectorySearcher ds = new DirectorySearcher(de, "cn=fv");
SearchResult sr = ds.FindOne();
DirectoryEntry usr = sr.GetDirectoryEntry();
usr.Invoke("ChangePassword",new object[]{"fv","12345qwert"});
usr.CommitChanges();
}
catch(Exception e)
{
Console.WriteLine(e.Message);
}
I an exception that says "Logon failure: unknown user name or bad password"
and it seems to me that I have
no way neither to change the password nor to distinguish a wrong credential
error from a an error due to a disabled account, a password expired.
Do you have any suggestion to solve this problem.
Thanks
Fabrizio
newsgroup!)
Hi all,
I try to change the password to a user that as to change the password at
first logon:
try
{
DirectoryEntry de = new DirectoryEntry();
de.AuthenticationType = AuthenticationTypes.ServerBind |
AuthenticationTypes.Secure;
de.Path = "LDAP://10.0.50.20/cn=users,dc=newtesthp,dc=com";
de.Username = "cn=fv,cn=users,dc=newtesthp,dc=com";
de.Password = "fv";
DirectorySearcher ds = new DirectorySearcher(de, "cn=fv");
SearchResult sr = ds.FindOne();
DirectoryEntry usr = sr.GetDirectoryEntry();
usr.Invoke("ChangePassword",new object[]{"fv","12345qwert"});
usr.CommitChanges();
}
catch(Exception e)
{
Console.WriteLine(e.Message);
}
I an exception that says "Logon failure: unknown user name or bad password"
and it seems to me that I have
no way neither to change the password nor to distinguish a wrong credential
error from a an error due to a disabled account, a password expired.
Do you have any suggestion to solve this problem.
Thanks
Fabrizio