Forum / Remote Desktop Manager - PowerShell Repository

PowerShell script to remove Security Groups and set View Permission on folders

  • Create an Issue
  • Cancel


The following script sample can be use to remove a Security Group on folders and replace it with View permission for specific roles.

Security Group to remove : MySecGrp
Roles to allow View Permission : DOWNHILL\Help Desk, DOWNHILL\Service Desk

$sgrp = Get-RDMSecurityGroup -Name "MySecGrp"

$sessions = Get-RDMSession | where {$_.SecurityGroup -eq $sgrp.ID}

foreach ($sess in $sessions)
# Remove the Security Group
$sess.SecurityGroup = '00000000-0000-0000-0000-000000000000'

# Set the View Permission
$view = @()
$view += "DOWNHILL\Help Desk"
$view += "DOWNHILL\Service Desk"
$sess.Security.ViewOverride = "Custom"
$sess.Security.ViewRoles = $view
$sess.Security.RoleOverride = "Custom"

Set-RDMSession $sess -Refresh

Best regards,

Érica Poirier


Clock2 yrs