How to resync the API credfile for the PSM
169
Created On 11/10/26 10:59 AM - Last Modified 11/10/26 15:51 PM
Objective
The executable 'apikeymanager.exe' is used to manage the credential file that is needed for the PSM. The file is located in your PSM installation directory, by default it is:
C:\Program Files (x86)\CyberArk\PSM\Vault
The PSMApp username can be found in the psmapp.cred file, located in the same vault directory mentioned above.
Environment
10.10;11.1;11;11.2;11.3;11.4;11.5;11.6;11.7;12.0;12.1;12.2;11.9;11.8;12.5;12.6;13.0;14.6 Privileged Access Manager (PAM, self-hosted) PSM
Procedure
1) Stop the service "Cyber-Ark Privileged Session Manager"
2) Navigate to your PSM installation directory, vault folder as described in the introduction above and open an administrative command prompt window to this folder. the commands below will be run in this CMDwindow.
Revoke API key:
apikeymanager.exe revoke -t <PSMApp username> -u <vault administrator username> -a "<https://<PVWA_FQDN>/PasswordVault/api/>"
For example:
ApiKeyManager.exe revoke -t PSMAppxxxxxxx -u administrator -a "https://xxx.xxx/passwordVault/api"
(NOTE: change relevant values where required)
(NOTE: change relevant values where required)
Create a new API key:
ApiKeyManager.exe add -f "<PSM installation folder path>\Vault\apigw.cred>" -t <PSMApp username> -u <vault username> -a "<https://<pvwa hostname>/passwordVault/api>"
For example:
ApiKeyManager.exe add -f "C:\Program Files (x86)\CyberArk\PSM\Vault\apigw.cred" -t PSMAppxxxxxx -u administrator -a "https://xxx.xxx/passwordVault/api"
(NOTE: change relevant values where required).
For example:
ApiKeyManager.exe add -f "C:\Program Files (x86)\CyberArk\PSM\Vault\apigw.cred" -t PSMAppxxxxxx -u administrator -a "https://xxx.xxx/passwordVault/api"
(NOTE: change relevant values where required).
vault.ini configuration:
Update/Ensure the Addresses and ApiKeyPath parameters in the vault.ini file exist and are accurate. If either are missing, add them. They need to be at the bottom of the vault.ini file under a header [API], don't put these entries anywhere else.
[API]
Addresses="<PVWA url>/api"
ApiKeyPath="<PSM installation folder path>\Vault\apigw.cred"
[API]
Addresses="<PVWA url>/api"
ApiKeyPath="<PSM installation folder path>\Vault\apigw.cred"
3) You may now start the PSM service again.
Final note, if the need arises you can also update the existing key pair with the following command:
ApiKeyManager.exe update -f "<PSM installation folder path>\Vault\apigw.cred"> -t <PSMApp username> -u <vault username> -a "https://<pvwa hostname>/passwordVault/api"