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


Clock10 days

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

OFFICE CLOSURE!
Although our various support queues will be monitored for emergencies, Devolutions' offices will be closed on September 2nd 2019.

signaturesignature

Clock10 days