- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.
06-07-2023 05:34 PM
Code snippet here, the body I'm sending in the request (in powershell);
$user = @{
memberName = $username
searchIn = $domain
membershipExpirationDate = ''
MemberType = "User"
Permissions = @{
useAccounts = $true
retrieveAccounts = $true
listAccounts = $true
addAccounts = $true
updateAccountContent = $true
updateAccountProperties = $true
initiateCPMAccountManagementOperations = $true
specifyNextAccountContent = $true
renameAccounts = $true
deleteAccounts = $true
unlockAccounts = $true
manageSafe = $true
manageSafeMembers = $true
backupSafe = $true
viewAuditLog = $true
viewSafeMembers = $true
accessWithoutConfirmation = $true
createFolders = $true
deleteFolders = $true
moveAccountsAndFolders = $true
requestsAuthorizationLevel1 = $true
requestsAuthorizationLevel2 = $false
}
}
But the response always shows this, all the permissions being set to false:
permissions : @{
useAccounts=False;
retrieveAccounts=False;
listAccounts=False;
addAccounts=False;
updateAccountContent=False;
updateAccountProperties=False;
initiateCPMAccountManagementOperations=False;
specifyNextAccountContent=False;
renameAccounts=False;
deleteAccounts=False;
unlockAccounts=False;
manageSafe=False;
manageSafeMembers=False;
backupSafe=False;
viewAuditLog=False;
viewSafeMembers=False;
accessWithoutConfirmation=False;
createFolders=False;
deleteFolders=False;
moveAccountsAndFolders=False;
requestsAuthorizationLevel1=False;
requestsAuthorizationLevel2=False
}
06-08-2023 08:10 AM
This is interesting. Does the API user running the command against Privilege Cloud have all the permissions you are trying to grant? It may be defaulting to 'false' because the user running the command has no permissions on the target safe.
06-08-2023 08:39 AM
Firstly, thank you for your response! This has been giving me a headache all week.
A few things to that answer -
1) It has the Privilege Cloud Administrator role which I thought should be sufficient, but I can look into modifying that as well
2) This is just a snippet of a larger automation I'm trying to script wherein the api user first creates the safe and then attempts to add access to it, and unless I'm mistaken I thought the creator of the safe has some default permissions that should give it enough power to grant the permissions, and finally
3) I've attempted this with just "listAccounts" and "useAccounts" set and it resulted in the same default false 😞
06-08-2023 08:44 AM
It seems like you have the correct permissions assigned (Privilege Cloud Administrator to add Safes, and the API user creates the safe so it will have full permissions and can grant them to other users).
If you run the script in verbose mode in PowerShell does it indicate at all why the values are changing to False? It almost seems like something is off with the syntax and the API is going back to the defaults, but it's hard to tell.
How is '$true' defined in the script? Maybe the variable isn't being populated correctly?
06-08-2023 10:53 AM
I got these two lines now as output..
VERBOSE: POST https://{domain}.privilegecloud.cyberark.cloud/PasswordVault/API/Safes/{safe}/Members/ with -1-byte payload
VERBOSE: received 901-byte response of content type application/json; charset=utf-8
$true is a default powershell variable it defaults to the bool True, but I've also tried this with just "true" or "True" as strings passed in the body as opposed to the bool value.
Redacted domain + safe name
08-16-2023 06:31 AM
Hello,
Did you end finding anything about it?
I have been getting the same issue, no right gets updated when using powershell as well.
08-16-2023 12:39 PM
We ended up rewriting it in Python and the permissions got updated as expected. I assume it's something with how Powershell handles it's booleans, but we had to re-write our scripts in Python.
08-17-2023 01:22 AM
I found a way to make it work.
I initially planned to generate a template and then fill it with the different values; ended putting the values in the template straight.
08-17-2023 01:22 AM
I found a way to make it work.
I initially planned to generate a template and then fill it with the different values; ended putting the values in the template straight.
08-17-2023 06:25 AM
Are you able to share? It would be helpful to have several options on how to do it.
08-17-2023 08:14 AM
I am sadly not able to share my whole script.. However, if you have the old powershell script you used, I could potentially take a look at it and see how we could make it work.
08-17-2023 08:14 AM
I am sadly not able to share my whole script.. However, if you have the old powershell script you used, I could potentially take a look at it and see how we could make it work.
08-17-2023 10:05 AM
I'm mainly curious how you created the template and used it as input for the api call
08-18-2023 01:39 AM
$bodyAddSafeMembers = @{
MemberName="$($GroupsLine[2])"
SearchIn= "Vault"
MembershipExpirationDate= $null
Permissions=@{
UseAccounts= $ProfilesLine[1]
RetrieveAccounts= $ProfilesLine[2]
ListAccounts= $ProfilesLine[3]
AddAccounts= $ProfilesLine[4]
UpdateAccountContent= $ProfilesLine[5]
UpdateAccountProperties= $ProfilesLine[6]
InitiateCPMAccountManagementOperations= $ProfilesLine[7]
SpecifyNextAccountContent= $ProfilesLine[8]
RenameAccounts= $ProfilesLine[9]
DeleteAccounts= $ProfilesLine[10]
UnlockAccounts= $ProfilesLine[11]
ManageSafe= $ProfilesLine[12]
ManageSafeMembers= $ProfilesLine[13]
BackupSafe= $ProfilesLine[14]
ViewAuditLog= $ProfilesLine[15]
ViewSafeMembers= $ProfilesLine[16]
AccessWithoutConfirmation= $ProfilesLine[17]
CreateFolders= $ProfilesLine[18]
DeleteFolders= $ProfilesLine[19]
MoveAccountsAndFolders= $ProfilesLine[20]
RequestsAuthorizationLevel1= $ProfilesLine[21]
RequestsAuthorizationLevel2= $ProfilesLine[22]
}
MemberType= "Group"
}
$ProfilesLine is a variable I generated using a foreach loop. I have a $ProfilesFiles with all the profiles I want to create
Same with $GroupLine
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!

