Get-RDUserSession

Get-RDUserSession

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

Syntax

Parameter Set: Default
Get-RDUserSession [[-CollectionName] <String[]> ] [[-ConnectionBroker] <String> ] [ <CommonParameters>]

Detailed Description

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

Parameters

-CollectionName<String[]>

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.

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ConnectionBroker<String>

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 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.

Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.RemoteDesktopServices.Management.RDUserSession

Examples

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

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

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

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

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.

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