Hello,
I'm having 2 Windows Servers(A and B) that are not in domain, both running Windows Server 2008 R2. On server A I'm logged in as Administrator. On server B I have user account that is only member of group Users. Account on server B DON'T have enabled"Prevent user from changing password".
I need to be able to automatically(by script or C++\C# application) change password of user on server B from server A.
My limitations are:
- I need to avoid things like opening RDP session and sending keystrokes.
- I need to avoid using 3rd part software(Paid or OpenSource - I know I can use pspassword for this).
I have tried this via vbs script that will Set oUser = OpenSDObject("WinNT://B/UserName,user", "B\UserName", "OldPassword", 1)
But when I try to change password via oUser.ChangePassword "newPassword" I get AccessDenid method. In fact it is same error message that I can receive if I will do "net user UserName *". It's coming from fact, that it's trying to set password,
not change it.
Is there way how can I allow this one user to set it's own password or how to make system do this change as if user would login via RDP and changed password via CTRL+ALT+DEL -> Change password?
Thank you for any help.