Hello
I want to set "Enforce password history" as 5 days using PS on a stand-alone (not joined to a domain) Windows 7. But I got an error as below:
Exception setting "PasswordHistoryLength": "Exception from HRESULT: 0x8000500F"
At line:2 char:10
+ $account. <<<< PasswordHistoryLength = 5
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException
Command:
$account = ([adsi]"WinNT://./TestUser")
$account.PasswordHistoryLength = 5
$account.psbase.commitchanges()
How can i set this property using PSv2.
Regards