I just found out that I have to set both minimum and maximum password age from undefined to 0 in order for this command to work. That does not seem to be documented ...
PS: Set-ADAccountPassword - Complexity Exception
-
01-07-2023 - |
سؤال
I've got problems with setting new passwords via Powershell on Server 2012 R2:
Set-ADAccountPassword -Identity testuser48
-OldPassword (ConvertTo-SecureString -AsPlainText "HelloPassword123#" -Force)
-NewPassword (ConvertTo-SecureString -AsPlainText "April456#@123" -Force)
I tried many different passwords but there's always an ADPasswordComplexityException
.
FullyQualifiedErrorId : ActiveDirectoryServer:1325,Microsoft.ActiveDirectory.Management.Commands.SetADAccountPasword
Are there any other things I could try? All password complexity rules (incl. length, ...) are disabled.
المحلول 2
نصائح أخرى
Can you use -Reset instead of -OldPassword? Try below to see if it works for you. Also is this in a domain or a standalone server?
Set-ADAccountPassword -Identity testuser48 -Reset
-NewPassword (ConvertTo-SecureString -AsPlainText "April456#@123" -Force)
لا تنتمي إلى StackOverflow