net accounts /uniquepw:5
This will make it that users are unable to re-use their last 5 passwords.
----------
Please accept as an answer if this was helpful.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello, I am trying to make a PowerShell script for work to require local users not on a domain to change their password on logon.
I am currently using 'net user $localAccount /passwordchg:yes /logonpasswordchg:yes' which does require them to change passwords on next login, however they can just set their new password to the same as their old password. I was wondering if there was any way to make it so they cant reuse their old password as their new, if anyone happens to know please let me know. Thanks
net accounts /uniquepw:5
This will make it that users are unable to re-use their last 5 passwords.
----------
Please accept as an answer if this was helpful.
Hello,
Yes, it is possible to prevent users from reusing their old password as their new password when changing it in a PowerShell script. Here are a few different approaches you can try: