CPM/SRS - winRc=8654: 'The account is controlled by external policy and cannot be modified.'
Symptom
When CPM/SRS tries to manage a Windows account, a winRc=8654 error is returned. Depending on which log is viewed, the error may look like the below:
- .Debug.Log:
- Reset password of user [<username>] on target [\\<address>] ended with code [8654].
- .log:
- Error in reconcilepass to user <domain>\<username> on domain <address>(\\<address>). Reason: The account is controlled by external policy and cannot be modified. (winRc=8654).
- pm.log:
- Code: 2101, Error: Error in reconcilepass to user <domain>\<username> on domain <address>(\\<address>). Reason: The account is controlled by external policy and cannot be modified. (winRc=8654).
Environment
Privileged Access Manager (PAM, self-hosted);Privilege Cloud Central Policy Manager (CPM);Secrets Rotation Service (SRS)
CPM/SRS
Windows Target
Cause
This error is caused by a legacy Windows Local Administrator Password Solution (Windows LAPS) policy being enforced on the target device. Windows LAPS is built into the Windows operating system. It's a Windows baseline security feature and can't be uninstalled. The CPM/SRS plugin uses the 'net user' Windows API command to reconcile target accounts. When a legacy LAPS policy is enforced on the target device, the plugin's use of the 'net user' API command in an attempt to modify the local accounts' password is rejected due to being "unexpected". This results in a winRc=8654 error to be returned.
Note, with the release of Microsoft update KB5025229 in April 2023, a legacy LAPS policy was automatically enforced on targets that received this patch.
winRc stands for Windows Return Code. Windows Return Codes are generated by Windows systems. The return code shown in the CPM/SRS logs and PVWA UI is from the target Windows machine and not from CPM/SRS.
winRc=8654 Error Definition:
ERROR_POLICY_CONTROLLED_ACCOUNT
8654 (0x21CE)
The account is controlled by external policy and cannot be modified.
Resolution
To resolve this error, either uninstall KB5025229 from the target device, or disable the enforcement of the legacy LAPS policy. To do so, create a REG_DWORD registry value named BackupDirectory under the HKLM\Software\Microsoft\Windows\CurrentVersion\LAPS\Config key on the target device and set it to the value zero (0). Setting this value prevents Windows LAPS from entering legacy Microsoft LAPS emulation mode. For more information, review the following article from Microsoft: Disabling legacy Microsoft LAPS emulation mode
Resources:
How does CPM Manage Windows Accounts Passwords
Windows System Error Codes
Windows Network Management Error Codes
Windows Routing and Remote Access Error Codes
Windows Sockets Error Codes