CPM/SRS - winRc=2221: 'The user name could not be found.'

CPM/SRS - winRc=2221: 'The user name could not be found.'

630
Created On 11/10/26 11:01 AM - Last Modified 11/10/26 13:01 PM


Symptom



When CPM/SRS tries to manage a Windows account, a winRc=2221 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 [2221]
  • .log:
    • Error in reconcilepass to user <username> on domain <address>(\\<address>). Reason: The user name could not be found. (winRc=2221).
  • pm.log:
    • Error in reconcilepass to user <username> on domain <address>(\\<address>). Reason: The user name could not be found. (winRc=2221).


Environment


Privileged Access Manager (PAM, self-hosted);Privilege Cloud Central Policy Manager (CPM);Secrets Rotation Service (SRS)


CPM/SRS
Windows Target
 



Cause



This error can be caused by multiple issues depending upon whether the target account is local or domain-based:
  • Local
    • The account does not exist in Local Users and Groups on the target device.
  • Domain
    • The account does not exist in Active Directory.
    • The username parameter of the account in PVWA does not match the sAMAccountName attribute in Active Directory.
    • The 'User logon name' in Active Directory is longer than 20 characters.


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=2221 Error Definition:
NERR_UserNotFound
2221 (0x8AD)
The user name could not be found.

 


Resolution



Steps to resolve the issues listed above:
 
Issue: The account does not exist in Local Users and Groups on the target device.
Resolution: Open lusrmgr.msc (Local Users and Groups) on the target device and select the Users folder.  If the account is not listed, recreate it here.

Issue: The account does not exist in Active Directory.
Resolution: Open ADUC (Active Directory Users and Computers) and search the domain for the account.  If the account is not found, recreate it.

Issue: The username parameter of the account in PVWA does not match the sAMAccountName attribute in Active Directory.
Resolution: Ensure that the username in PVWA matches the sAMAccountName (User logon name (pre-Windows 2000)) attribute in AD.
Background: The sAMAccountName and userPrincipalName attributes in AD do not have to match, thus different usernames can exist for the same account in the directory.  The non-LDAP Windows plugin utilizes Windows API commands to manage both local and domain-based Windows accounts.  The Windows API commands utilize the sAMAccountName (User logon name (pre-Windows 2000)) attribute in AD and NOT the userPrincipalName (User logon name) attribute.  This is why the username in PVWA must match the sAMAccountName attribute, not the userPrincipalName attribute.

Issue: The 'User logon name' in Active Directory is longer than 20 characters.
Resolution: Ensure that the username set for 'User logon name' in AD is not longer than 20 characters.
Background: ADUC limits the sAMAccountName attribute to 20 characters.  However, this limit does not exist for the userPrincipalName attribute.  While this is a non-issue when working in AD, the CPM plugin is unable to handle the UPN attribute having more than 20 characters.  This is a known issue and is detailed HERE.


Additional Information


Details

SYMPTOM: 

While trying to reconcile an account,The following error message appears in CPM's information tab on the right pane in the Account's details:

CACPM405E Reconciling Master Safe: XXX, Folder: XXX, Object: XXX failed (try #0). The Master was disabled because an unrecoverable error was detected. Code: 2105, Error: Error in reconcilepass to user XXX. Reason: The user name could not be found. (winRc=2221). Reconcile account details - Safe: XXX, Folder: XXX, Object: XXX The CPM is trying to reconcile this password because its status matches the following search criteria: ResetImmediately.

 
PROBLEM: 
The Reconcile Account cannot find the username on the remote target machine.
The error message refers to the remote user account and not the Reconcile's account itself.
 
SOLUTION: 
Make sure that the relevant username does exist in "Local Users and Groups" on the remote machine.

Note: While reconciliation is performed, the API specifies full account name, including authentication domain, as the account whose credentials should be reset. For local accounts presence of this error may indicate that due to latencies in DNS propagation CPM is attempting to reconcile a password on a machine that had recently taken a DHCP-allocated address of the intended reconciliation target



Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000001TmMCAU&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail