Shared Services - Identity Sync Roles with Privilege Cloud Vault Users
Objective
Update Feb, 2025 - Dev Note:
With the release of 14.5 (link) + (ER Link) it addresses this issue and fixes it natively.
With that said, the new automatic solution runs once 24h (nighttime of the vault) syncs the roles and users.
If you want to verify the new solution is running nightly, audit the user "SYNCSERVICEUSER" it will usually be a delete action this system user is performing on other users.
However, the overnight sync will not remove users in the vault that do not or have never existed in Identity. This can often happen post migration. In these cases this script should be used to remove the users from the vault that are no longer needed.
The script is also useful if you need to remove the users without waiting for the overnight sync.
Intro:
This script will run a comparison between all Identity roles starting with "Privilege Cloud*" and the Vault users.
The idea is to provide a temp solution (ER is planned for later part of this year) for customers that would like to free up vault license space without deleting the user in identity, but instead, just removing it from Privilege Cloud roles.
This article will break down the process into two:
- Running the script and examining the output.
- Removing the extra users only from the vault.
Environment
14.6;25.9 Privilege Cloud;Identity
Procedure
Download (Inside the Reports Folder):
https://community.cyberark.com/marketplace/s/#a352J000000GWAZQA4-a392J000002tNgLQAU
Prerequisites:
- This is meant only for ISPSS customers.
- The machine you are running from has HTTPS/443 connectivity to the platform (e.g., https://mikeb.cyberark.cloud).
- User must be Identity user, have "User Management" permissions and be a Privilege Cloud Admin to run this task.
See Example (marked in yellow the only required permissions):
- Do NOT use InstallerUser for this task.
- If you are mapping users from external sources, make sure all identity connectors are online. Identity queries your AD during runtime to retrieve the list of users which are mapped via groups.
- Make sure you extract the entire Priv cloud tools zip and keep the format.
How to Run:
- Navigate to Cyberark PrivilegeCloud Tools\Reports\SyncIdentityRolesWithVaultUsers
- Run the script from PowerShell:
.\SyncIdentityRolesWithVaultUsers.ps1 -PortalURL https://<yourSubDomainHere>.cyberark.cloud - Script will check if you have minimal permissions required to run user query on both systems.
- Script will look at all the users in the vault and try to find their match in Identity.
- Script will reload rights & refresh license type for every user, to have most accurate details, then proceed to compare.
- Lastly, script will try to detect discrepancies between Identity and the vault and suggest which users should be deleted.
Screenshots:
Users are aligned between Identity & Vault
Script is reloading Rights & Refreshing UserType for every Vault user found, even before we begin the comparison:
Users that exist in the vault, and also exist in Identity, but are not part of any Priv Cloud Role (In Identity), therefore should be removed from the vault:
Users that exist in the Vault, but do not exist in Identity at all:
How often to run the script:
- You can run the script as often as you like, there are no restrictions.
- Keep in mind this script is now obsolete, the entire solution it provides is now built in and part of the product (starting from 14.5 Feb, 2025 release).
What to do with the results
- The script will output many files for your convenience (mainly for troubleshooting in case you need it). But we only care about the file called VaultUsersToDelete.txt as these users are consuming vault license.
- Remove the users by using another script we provide in the Priv cloud tools bundle under "DeleteUsers" folder (DeleteUsersFromVault.ps1). Lookup "Shared Services - Delete Users from Privilege Cloud"