How do I change a local user account password remotely using VB.NET/C#?
I have looked into the DirectoryEntry class and know how to add users to a group but cannot figure out how to change a (local) password.
How do I change a local user account password remotely using VB.NET/C#?
I have looked into the DirectoryEntry class and know how to add users to a group but cannot figure out how to change a (local) password.
Using .net 3.5:
PrincipalContext context = new PrincipalContext(ContextType.Domain);
UserPrincipal user = UserPrincipal.FindByIdentity(context, "user");
The user can change her own password:
user.ChangePassword("old", "new");
Or, if you run as AD administrator, you can reset it:
user.SetPassword("1234567");