Get Session Folder in Powershell

Get Session Folder in Powershell

avatar
michael14
Disabled

Hello,

i am looking for a way to get the folder(s) of a RDM Session Object in Powershell. Is there a way to do this?

Regards

Michael

All Comments (3)

avatar

Hello,

The Group property of the session object contains the path where the session is located.

Here are two different methods to get the Group property.

$session = Get-RDMSession -Name "MySession"
$folder = $session.Group
Or

$session = Get-RDMSession -Name "MySession"
$folder = Get-RDMSessionProperty -ID $session.ID -Property "Group"
Best regards,

Érica Poirier

avatar

Hello,

thats great, thank you very much to point me to the right direction. Another question is now how to retrieve all the folders of a session with multiple shortcuts. Is there a way too?

Kind regards

Michael

avatar

Hello,

To retrieve all folders of a session with shortcuts, you will get the information in the Group property and all folders are separated by a semi-colon.

When using Get-RDMSession cmdlet to get a session with shortcuts, it returns an array of sessions that contains a number of entries equal to the number of shortcuts (original session included). So you will need to refer to one element of this array to get the Group property. All array element will have the same Group value.

PS C:\> $session = Get-RDMSession -Name "MySession"
PS C:\> $session

Name Group
---- -----
MySession Tools;TestDevo
MySession Tools;TestDevo


PS C:\> $session[0].Group
Tools;TestDevo

Best regards,

Érica Poirier