Reset Active Directory Users to Require Passwords

Use PowerShell to reset a user's Active Directory profile to require a password.

John Savill

April 10, 2014

1 Min Read
password prompt

Q: I have some users who were configured in Active Directory to not require passwords. I need to reset their profiles to require passwords; how can I easily accomplish this?

A: There are several user account controls that configure user account security properties. These properties are documented in the Microsoft Support article "How to use the UserAccountControl flags to manipulate user account properties." You can use the Set-ADAccountControl cmdlet to easily manipulate these properties. For example, to require password use:

Set-ADAccountControl -PasswordNotRequired $false

You can combine various properties to create a single value stored in the UserAccountControl attribute. For an enabled account (512) with the password not required (32), the value is 544. This feature allows you to use a single line of Windows PowerShell code to reset any normal account that was configured to not require a password to require one going forward:

Get-ADUser –Filter {UserAccountControl -like "544"} | Set-ADAccountControl -PasswordNotRequired $false

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like