Get-RDUserSession

Gets a list of all user sessions in a collection or in a Remote Desktop deployment.

Syntax

Get-RDUserSession
   [[-CollectionName] <String[]>]
   [[-ConnectionBroker] <String>]
   [<CommonParameters>]

Description

The Get-RDUserSession cmdlet gets a list of all user sessions in a collection or in a Remote Desktop deployment.

Examples

Example 1: Retrieve a list of user sessions in a collection

PS C:\> Get-RDUserSession -ConnectionBroker "rdcb.contoso.com"

This command lists user sessions in a collection that is associated with the RD Connection Broker server named rdcb.contoso.com.

Example 2: Retrieve a list of user sessions in multiple collections

PS C:\> Get-RDUserSession -ConnectionBroker "rdcb.contoso.com" -CollectionName @("Session Collection","Virtual Desktop Collection")

This command lists user sessions in the collections named Session Collection and Virtual Desktop Collection. The cmdlet associates these collections with the RD Connection Broker server named rdcb.contoso.com.

Optional Parameters

-CollectionName

Specifies an array that contains the name of the virtual desktop collection that contains the user sessions. If this parameter does not appear, the cmdlet returns all user sessions across all virtual desktop collections.

Type:String[]
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ConnectionBroker

Specifies the Remote Desktop Connection Broker (RD Connection Broker) server for this Remote Desktop deployment. Remote users connect to this server to obtain views of available firstref_server_7 RemoteApp programs, session-based desktops, and virtual desktops. If this parameter does not appear, the default value is the fully qualified domain name (FQDN) of the local host.

Type:String
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Microsoft.RemoteDesktopServices.Management.RDUserSession