using System.DirectoryServices;
private void ChangePass()
{
DirectoryEntry myDirectoryEntry;
myDirectoryEntry = new DirectoryEntry(@"WinNT://127.0.0.1/TheUserNameOnTheLocalMachine, User");
object[] oPassword = new object[] {"TheNewPassword"};
myDirectoryEntry.Invoke("setPassword", oPassword);
myDirectoryEntry.CommitChanges();
{