I've seen plenty of documentation of how to reset a user's password by running
net user <username> * /domain
or locally
net user <username> <new_password>
But I am not domain admin for the current domain, so I am not allowed to change the password via net user <my_username> * /domain
(Access is denied).
What I can do though, is to hit CTRL+ALT+DEL and click on "Change Password", where I have to re-enter my current password and give a new password:
Question: How can I script that? I want to change my password via command line. Possible?
Bonus information: I'm on a Windows XP SP3 machine.
Note: Company policy is to make the user change their password every two weeks. And you cannot use your last 24 passwords... Since I don't want to always remember a new password I just iterate through "password1"..."password24" manually and in the end I am back to my old password. It would be great to do this with a small batch instead of the manual way.
Try this, i dont know if this will work fot you. its VB script
check this http://technet.microsoft.com/en-us/library/cc780332%28WS.10%29.aspx!
Check this https://technet.microsoft.com/en-us/library/ee617261.aspx.... There is -Oldpassword param which along with -Newpassword param can achieve this. Remember if you are not a Domain Admin then you need to know the old pwd to do this. Plus when you use the -Oldpassword param ,dont use -reset param.
This article from The Scripting Guys has the code and an explanation of how to change an Active Directory password through PowerShell. You generally would need to be a member of the Domain Admins or Account Operators group, but there's a chance it could work with your own account. I haven't tried that yet myself.
https://blogs.technet.microsoft.com/heyscriptingguy/2010/08/17/how-to-change-a-users-active-directory-password-with-powershell/
Unfortunately I am not in the same system environment anymore, but it should be noted that Sysinternals updated their tool PsPasswd.
Maybe this would have been the solution - I still don't know whether I could have changed my password with that tool. I could change the password via CTRL+ALT+DELETE.
The answer by @MealstroM requires admin otherwise you get Access denied. Instead of
SetPassword
one has to callChangePassword(old,new)
:This knowledge base article indicates that you can't with the
net
command, not without domain admin privileges. You may be able to do it with a PowerShell cmdlet, but you may run afoul of various domain policies (for example, password histories), and you may still need domain admin privileges. I suspect you're out of luck.Just do this from command prompt...
net user domain\username *
(notice the asterisk on the end after a space)
It will prompt you for the new password without having to enter the old.
With this info you can create a script or batch file and a csv file for your passwords.