PowerShell adjust secruity on session items

PowerShell adjust secruity on session items

avatar

Hello there,

i'm currently working on a powershell script to automize most of the tasks for new users / groups in RDM.

i'm now facing a issue where i want to assign a specific toplogy of roles and users to a new VAULT.

Like this:
Role A, B, C and so on
New Vault (No Secruity Setttings / No one can add or edit something)
- Folder 1
--Session Secruity Custom: Role A Full Control
- Folder 2
--Session Secruity Custom: Role B Full Control
- Folder 3
--Session Secruity Custom: Role C Full Control
...

Everything is fine until i want to edit the Secruity permissions on the folders/session.
$rdmvault="New Vault"
$rdmrole="Role A"
$rdmfolder="Folder A"
#help https://forum.devolutions.net/topics/29552/powershell-script-to-remove-security-groups-and-set-view-permission-on
#https://forum.devolutions.net/topics/29716/renaming-a-role-and-update-permissionsg
$role=Get-RDMRole -Name $rdmrole
$vault=Get-RDMVault -Name $rdmvault

Set-RDMCurrentRepository $vault
Update-RDMUI
New-RDMSession -Name $rdmfolder -Type Group -SetSession

$sess=Get-RDMSession -Name $rdmfolder
# Set the View Permission
$view = @()
$view += $rdmrole
$sess.Security.ViewOverride = "Custom"
$sess.Security.ViewRoles = $view
$sess.Security.RoleOverride = "Custom"

Set-RDMSession $sess -Refresh
Update-RDMUI

So with the above settings i am able to edit the view permissions as mentioned in a other forum article.
To my bad i cannot add others.

I could create a template where i place some settings and edit it, but thats not the result i want to have. I want to compleatly add new permissions.
With that i am able to view the current settings as mentioned before.
$sess.Security.Permissions


IsEmpty : False
Override : Custom
Right : Add
Roles : {Role_A}
RoleValues : Role_A

How can i add new secruity settings like, "EDIT", "DELETE" and so on?

Many thanks


All Comments (1)

avatar

Hello,

All other permissions are located in the Security.Permissions property of the session. This property is an array of ConnectionPermission objects.

Attached to this post, you will find a script to update the permissions based on a CSV file that replicates the folder structure.

Let us know if you have any questions about it.

Best regards,

Érica Poirier

SetPermissions.ps1

Modele_DPSv3.csv