[PrivCloud] How to add AD Group as Safe Member via Rest API
Symptom
In Privilege Cloud, when attempting to add the AD group to a safe as safe member, there is error response:
{"ErrorCode":"SFWS0010","ErrorMessage":"Member <username>@lab.local has not been defined."}
After adding the group manually (via UI) then it works.
Environment
14.0 Privilege Cloud Cyber-Ark API/SDK
Cyber-Ark API/SDK REST API
Privilege Cloud
Cause
To add the AD group in Privilege Cloud via the REST API, the value for "searchIn" should be the directory GUID
Resolution
To add the AD group in Privilege Cloud via the REST API, the value for "searchIn" should be the directory GUID, and not the name of the directory "lab.local". The directory GUID can be found by adding a group/user to a safe with developer tools running. Once completed save the action as a HAR file and then search for "SearchIn" in the HAR file to find the directory GUID. Please update the body to use your directory GUID and try again.
See below example body:
{"MemberName":"TestFor@lab.local","MembershipExpirationDate":null,"Permissions":{"listAccounts":true,"useAccounts":true,"retrieveAccounts":true,"addAccounts":false,"updateAccountProperties":false,"updateAccountContent":false,"initiateCPMAccountManagementOperations":false,"renameAccounts":false,"deleteAccounts":false,"unlockAccounts":false,"manageSafe":false,"viewSafeMembers":false,"viewAuditLog":false,"backupSafe":false,"accessWithoutConfirmation":false,"moveAccountsAndFolders":false,"createFolders":false,"deleteFolders":false,"requestsAuthorizationLevel1":false,"requestsAuthorizationLevel2":false},"SearchIn":"sda213213-43d0-46dd-4f52-2dsd2gddf07a","MemberType":"Group"}