How to change a user's Windows 2000/XP password

Share on:

Mi capita spesso di doverlo fare e ogni volta devo cercarlo... 😜

<code>

using

System.DirectoryServices;

...

DirectoryEntry myDirectoryEntry;
myDirectoryEntry = new DirectoryEntry(@"WinNT://MyDirectoryServer/MyUsername,User");

myDirectoryEntry.Invoke("setPassword", "MyNewPassword");
myDirectoryEntry.CommitChanges();

</code>

Fonte:Β How to change a user's Windows 2000/XP password

 
Post originale