Editing RootFolder Permissions

Editing RootFolder Permissions

avatar

Hi,

We are currently updating the security of our Remote Desktop Manager.
In orde to do so, we would like to modify/replace the existing RootFolder-Permissions with predefined ones.

# 'Template_Vault' being a vault on which we defined our final permissions
Set-RDMCurrentRepository (Get-RDMRepository -Name 'Template_Vault')
# recovering existing permissions on the rootsession
$RootSessionSecurity = (Get-RDMRootSession).Security
# 'Vault 1' being a vault on which we wish to adapt the permissions
Set-RDMCurrentRepository (Get-RDMRepository -Name 'Vault 1')
# reovering existing rootsession
$Temp = Get-RDMRootSessions
# applying the template permissions onto the root folder
$Temp.Security = $RootSessionSecurity
# saving the changes made
Set-RDMRootSession $Temp

But when attempting to modify the existing permissions, I get the following error:

$Temp.Security = $TemplateRootFolderSecurity
InvalidOperation: 'Security' is a ReadOnly property.


I am assuming that this isn't the intended way through which permission changes can be made.
Could you guide me towards the correct approach?

These are the environment information:

PowerShell Version: 7.3.2
Module Version: 2022.3.1.2
DB Type: Devolutions Server
DB Version: 2022.3.5.0


Best regards,

Alexis De Jaeger

All Comments (1)

avatar

Hi Alexis

Indeed, Security is read only but properties inside are writable.
You can use this little script to scan the Security object and copy the value of each property.

$RootSessionSecurity.Security.PSObject.Properties | ForEach { $Temp.Security.PSObject.Properties[$_.Name].Value = $_.Value }


Let me know if this helps or if you have further questions
Regards

Jonathan Lafontaine