When creating user accounts in PowerShell, the InvalidPasswordException error appears.
New-LocalUser: An exception of type “Microsoft.PowerShell.Commands.InvalidPasswordException”.
The Local Group Policy for password complexity requirements do not match the input, or the minimum password length is not met.
In Local Group Policy (gpedit.msc), change the Minimum Password Length, 0 for no Minimum Password Length.
The following PowerShell command creates a user account with a password from the same command line, useful for script processing.
New-LocalUser user1 -Password (ConvertTo-SecureString "8170af" -AsPlainText -Force) -FullName user1 -Description user1 -PasswordNeverExpires -UserMayNotChangePassword
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?