Forum / Remote Desktop Manager - PowerShell Repository

Lising Session on a group

  • Create an Issue
  • Cancel


Hello,

We have a group tree of sessions/other groups and I would like to list session without sub entries:

Example:

\
\Client

\Client\session1
\Client\session2
\Client\subgroup1
\Client\subgroup1\session3
\Client\subgroup1\session4
\Client\subgroup2\session5
If I use

Get-RDMSession -GroupName Clients

it's only returning Client object

If I use :
Get-RDMSession -GroupName Clients -IncludeSubFolders

It's returning all session, even those on sub groups

I would lile to get a list which is returniong only "sesson1, session2, subgorup1, subgroup2"

Thanks in advance for Help

Antoine


Clock4 mths

Hello,

Could you try these scripts if they solve your need?

This script returns the entries including the parent folder

$group = 'myfoldername'
Get-RDMSession | Where-Object {$_.Group -eq $group -or ($_.ConnectionType -eq 'Group' -and $_.Group -eq ($group + "\" + $_.Name))}

Or this one without the parent folder

$group = 'myfoldername'
Get-RDMSession | Where-Object {($_.ConnectionType -ne 'Group' -and $_.Group -eq $group) -or ($_.ConnectionType -eq 'Group' -and $_.Group -eq ($group + "\" + $_.Name))}

Best regards,



David Grandolfo

Happy Holiday Season!
Although our various support queues will be monitored during the coming holiday season, Devolutions' offices will be closed from December 24th, 2019, to January 1, 2020, inclusively.

signaturesignature

Clock4 mths