CmdID / PowerShell / Cmdlets / Get
Get-RDUserSession
Gets a list of all user sessions in a collection or in a Remote Desktop deployment. Windows Server PowerShell reference
From the Windows Server PowerShell reference 2 parameters Its page in the reference
Parameters
-CollectionNameSpecifies an array that contains the name of the virtual desktop collection that contains the user sessions.-ConnectionBrokerSpecifies the Remote Desktop Connection Broker (RD Connection Broker) server for this Remote Desktop deployment.