New-ADUser : The Password Does Not Meet The Length, Complexity, Or History

Nitin Upadhyay | Tue, 29 Jun 2021 at 15:40 hours | Replies : 2 | Points : 25

Category : Active Directory


Hi,

I am getting below error while creating AD users using powershell. Also, the newly created Account is getting disabled. Please help

Error:

New-ADUser : The password does not meet the length, complexity, or history requirement of the domain.
At line:1 char:1
+ New-ADUser -Name "userabcdefgh001" -SamAccountName "userabcdefgh001 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (CN=userabcdefgh001,DC=xyz,DC=com:String) [New-ADUser], ADPasswordCom
   plexityException
    + FullyQualifiedErrorId : ActiveDirectoryServer:1325,Microsoft.ActiveDirectory.Management.Commands.NewADUser

PS C:\Users\XYZ>

 

 


This Question is already solved Click To See The Answer


Hi Nitin,

Looks like your domain is configured for complex password policy, So please try to keep complex password which meets your AD Domain requirements.

Run below command and try.

 

With Clear text password in command:

New-ADUser -Name "Test" -GivenName "TestUser" -Surname "User" -SamAccountName "testuser" -UserPrincipalName "testuser@domain.com" -Path "OU=Users,DC=Experts-adda,DC=com" -AccountPassword (ConvertTo-SecureString 'p@ssw0rd' -AsPlainText -Force) -Enabled $true

With Secure text password in command:

New-ADUser -Name "Test" -GivenName "TestUser" -Surname "User" -SamAccountName "testuser" -UserPrincipalName "testuser@domain.com" -Path "OU=Users,DC=Experts-adda,DC=com" -AccountPassword(Read-Host -AsSecureString "Input Password") -Enabled $true

Hope it will help you.

Thanks Santosh! This is resolved.