Forum / Remote Desktop Manager - PowerShell Repository

List all session, include linked credentials

So you want to list all sessions (ID , Name, Host, CredentialName) for that we need to construct a list and fetch the name of the credential.

$s = Get-RDM-Session |

foreach { new-Object Object
| Add-Member NoteProperty ID $_.ID –PassThru
| Add-Member NoteProperty Name $_.Name –PassThru
| Add-Member NoteProperty CredentialConnectionID (Get-RDM-Property –ID $_.ID –Property “CredentialConnectionID” ) –PassThru
| Add-Member NoteProperty Host (Get-RDM-Property –ID $_.ID –Property “Url” ) –PassThru
| Add-Member CredentialName $null –PassThru }; $b = $s
| Where-Object {$_.CredentialConnectionID}
| foreach { $_ | Add-Member NoteProperty CredentialName (Get-RDM-Property –ID $_.CredentialConnectionID –Property “Name” ) –PassThru -Force };
$s | select * -exclude CredentialConnectionID


edited by stefane on 4/11/2013

Stefane Lavergne

signaturesignature

Clock6 yrs