Force all users to change password using powershell

From The IT Community
Jump to: navigation, search




There can be times (maybe the security policy of the company has changed) when you want all users to change their passwords.

Using PowerShell this can be done in one command.


Here is how to force all users to change their password using powershell:

  • Open a PowerShell as a user that has enough rights to perform this operation.
  • Type the following
Get-ADUser -Filter * -SearchBase "ou=TestOU,dc=theitcommunity,dc=com" | Set-ADUser -ChangePasswordAtLogon $true

and press enter.

You will have to change theitcommunity to the name of your domain and TestOU to the name of the OU where your users are in.

Note: It is recommended that you first create a new OU, move one user into it and test the script there.



Was this article helpful? Then please donate to keep The IT Community alive...

If you found this article helpful please share it, comment and help others by writing your own article.






Translate this page: