Ciao a tutti. C'è un modo per cambiare la password di dominio da un'applicazione web?
Grazie.
Ciao a tutti. C'è un modo per cambiare la password di dominio da un'applicazione web?
Grazie.
Dovresti approfondire l'uso delle varie classi che trovi nel namespace
System.DirectoryServices
http://msdn2.microsoft.com/en-us/lib...yservices.aspx
Ti copio e incollo un esempio
string adspath = "LDAP://SYST.ctc.edu/CN="+username+",OU=Users,OU=Seattle District (060 - SCCD),OU=Washington Colleges,DC=SYST,DC=ctc,DC=edu";
DirectoryEntry entry1 = new DirectoryEntry (adspath, @"domain\username", "PWD", AuthenticationTypes.Secure);
string OldPassword = "OLDPWD";
string NewPassword = "mynewsecre@t!#*";
object[] tt = new object[]{OldPassword, NewPassword};
try
{
entry1.Invoke( "ChangePassword" ,tt );
entry1.Properties["userAccountControl"].Value = 0x0200;
entry1.CommitChanges();
}
catch(Exception excp)
{
throw(excp);
}
Saluti a tutti
Riccardo