Citrix Daas SDK

Get-BrokerSession

Gets a list of sessions.

Syntax

Get-BrokerSession
   [[-SessionKey] <Guid>]
   [-AgentVersion <String>]
   [-AnonymousUserId <String>]
   [-ApplicationInUse <String>]
   [-AppState <SessionAppState>]
   [-AppStateLastChangeTime <DateTime>]
   [-AutonomouslyBrokered <Boolean>]
   [-BrokeringDuration <Int32>]
   [-BrokeringTime <DateTime>]
   [-BrokeringUserName <String>]
   [-BrokeringUserSID <String>]
   [-CatalogName <String>]
   [-CbpVersion <CBPVersion>]
   [-ClientAddress <String>]
   [-ClientName <String>]
   [-ClientPlatform <String>]
   [-ClientProductId <Int32>]
   [-ClientVersion <String>]
   [-ConnectedViaHostName <String>]
   [-ConnectedViaIP <String>]
   [-ConnectionMode <ConnectionMode>]
   [-ControllerDNSName <String>]
   [-DesktopGroupName <String>]
   [-DesktopGroupUid <Int32>]
   [-DesktopKind <DesktopKind>]
   [-DesktopSID <String>]
   [-DesktopUid <Int32>]
   [-DeviceId <String>]
   [-DNSName <String>]
   [-EntitlementPolicyRuleUid <Int32>]
   [-EstablishmentDuration <Int32>]
   [-EstablishmentTime <DateTime>]
   [-HardwareId <String>]
   [-Hidden <Boolean>]
   [-HostedMachineName <String>]
   [-HostingServerName <String>]
   [-HypervisorConnectionName <String>]
   [-IdleDuration <TimeSpan>]
   [-IdleSince <DateTime>]
   [-ImageOutOfDate <Boolean>]
   [-InMaintenanceMode <Boolean>]
   [-IPAddress <String>]
   [-IsAnonymousUser <Boolean>]
   [-IsPhysical <Boolean>]
   [-LaunchedViaHostName <String>]
   [-LaunchedViaIP <String>]
   [-LaunchedViaPublishedName <String>]
   [-LaunchedViaWorkspace <Boolean>]
   [-LogoffInProgress <Boolean>]
   [-LogonInProgress <Boolean>]
   [-MachineName <String>]
   [-MachineSummaryState <DesktopSummaryState>]
   [-MachineUid <Int32>]
   [-Metadata <String>]
   [-OSType <String>]
   [-PersistUserChanges <PersistUserChanges>]
   [-PowerState <PowerState>]
   [-PreferredZoneName <String>]
   [-PreferredZoneUid <Guid>]
   [-Protocol <String>]
   [-ProvisioningType <ProvisioningType>]
   [-ReceiverIPAddress <String>]
   [-ReceiverName <String>]
   [-SecureIcaActive <Boolean>]
   [-SessionId <Int32>]
   [-SessionReconnection <SessionReconnection>]
   [-SessionState <SessionState>]
   [-SessionStateChangeTime <DateTime>]
   [-SessionSupport <SessionSupport>]
   [-SessionType <SessionType>]
   [-StartTime <DateTime>]
   [-TenantId <Guid>]
   [-UntrustedUserName <String>]
   [-UserFullName <String>]
   [-UserName <String>]
   [-UserSID <String>]
   [-UserUPN <String>]
   [-ZoneName <String>]
   [-ZoneUid <Guid>]
   [-ApplicationUid <Int32>]
   [-SharedDesktopUid <Int32>]
   [-Property <String[]>]
   [-ReturnTotalRecordCount]
   [-MaxRecordCount <Int32>]
   [-Skip <Int32>]
   [-SortBy <String>]
   [-Filter <String>]
   [-FilterScope <Guid>]
   [<CitrixCommonParameters>]
   [<CommonParameters>]
<!--NeedCopy-->
Get-BrokerSession
   [-Uid] <Int64>
   [-Property <String[]>]
   [<CitrixCommonParameters>]
   [<CommonParameters>]
<!--NeedCopy-->

Description

Retrieves sessions matching all the specified criteria. If no parameters are specified this cmdlet enumerates all sessions.

————————– BrokerSession Object

The session object returned represents a session on a machine in the site. The session could be for a desktop or application

  • AgentVersion (System.String)

    Version of the Citrix Virtual Delivery Agent (VDA) installed on the machine.

  • AnonymousUserId (System.String)

    User ID associated with an anonymous session. This is a non-Windows identity and does not relate to the user account under which the session is running. Not all anonymous sessions have associated user IDs.

  • ApplicationsInUse (System.String[])

    List of applications in use in the session. Applications are identified by their administrative name.

  • AppState (Citrix.Broker.Admin.SDK.SessionAppState)

    The app state of the session. Valid values are PreLogon, PreLaunched, Active, Desktop, Lingering and NoApps.

  • AppStateLastChangeTime (System.DateTime?)

    The time when the session entered the current app state.

  • AutonomouslyBrokered (System.Boolean)

    Indicates whether this is an HDX session established by direct connection without being brokered.

  • BrokeringDuration (System.Int32?)

    Time taken to broker the session (in milliseconds).

  • BrokeringTime (System.DateTime?)

    Time at which the session was brokered.

  • BrokeringUserName (System.String)

    The user name of the brokering user.

  • BrokeringUserSID (System.String)

    The SID of the brokering user.

  • CatalogName (System.String)

    The name of the catalog that the machine hosting the session is assigned to.

  • CbpVersion (Citrix.Broker.Admin.SDK.CBPVersion?)

    The version of CBP that the VDA is currently registered with. This will be null when the VDA is not registered.

  • ClientAddress (System.String)

    The IP address of the client connected to the session.

  • ClientName (System.String)

    The host name of the client connected to the session.

  • ClientPlatform (System.String)

    The name of client platform, as indicated by client product ID.

  • ClientProductId (System.Int32?)

    The product ID of the client connected to the session.

  • ClientVersion (System.String)

    The version of the Citrix Receiver running on the client connected to the session.

  • ConnectedViaHostName (System.String)

    The host name of the incoming connection. This is usually a gateway, router or client.

  • ConnectedViaIP (System.String)

    The IP address of the incoming connection This is usually a gateway, router or client.

  • ConnectionMode (Citrix.Broker.Admin.SDK.ConnectionMode?)

    The way in which the most recent connection to the session was established. Valid modes are:

    • Brokered: established through the XenDesktop Broker (for example, using StoreFront).
    • Unbrokered: direct connection (for example, using the console or direct RDP/HDX).
    • LeasedConnection: established through the XenDesktop Broker using a connection lease.
    • VdaHighAvailabilityMode: direct connection while VDA in high-availability mode.
    • ThirdPartyBroker: established through a third-party Broker.
    • ThirdPartyBrokerWithLicensing: established and licensed through a third-party Broker.
  • ControllerDNSName (System.String)

    The DNS host name of the controller that the session’s hosting machine is registered with.

  • DesktopGroupName (System.String)

    Name of the desktop group of the machine the session is on.

  • DesktopGroupUid (System.Int32)

    UID of the desktop group of the machine the session is on.

  • DesktopKind (Citrix.Broker.Admin.SDK.DesktopKind)

    Indicates if the session is shared or private.

  • DesktopSID (System.String)

    The Windows SID of the machine the session is on.

  • DesktopUid (System.Int32)

    For a desktop session, the unique identifier of the desktop.

  • DeviceId (System.String)

    Unique identifier for the client device that has most recently been associated with the session.

  • DNSName (System.String)

    The DNS host name of the machine hosting the session.

  • EntitlementPolicyRuleUid (System.Int32?)

    The entitlement policy rule that granted the user the entitlement to launch the session. Only present for shared resources.

  • EstablishmentDuration (System.Int32?)

    Duration that it took to establish the session.

  • EstablishmentTime (System.DateTime?)

    Time at which the session was established.

  • HardwareId (System.String)

    Unique identifier for the client hardware that has been most recently associated with the session.

  • Hidden (System.Boolean)

    Flag to indicate if the session is currently hidden from the user and not to be reconnected to.

  • HostedMachineName (System.String)

    The friendly name of a hosted machine running the session, as used by its hypervisor. This does not necessarily match either the DNS or AD name of the machine.

  • HostingServerName (System.String)

    DNS name of the hypervisor that is hosting the machine hosting the session.

  • HypervisorConnectionName (System.String)

    The name of the hypervisor connection that the machine hosting the session has been assigned to.

  • IdleDuration (System.TimeSpan?)

    Period for which session has been idle, or null if it is not considered idle.

  • IdleSince (System.DateTime?)

    Time at which session went idle

  • ImageOutOfDate (System.Boolean?)

    Denotes whether the VM image for a hosted machine is out of date and due to be updated to a new master image when the machine next reboots.

  • InMaintenanceMode (System.Boolean)

    Denotes whether the machine hosting the session is in maintentance mode.

  • IPAddress (System.String)

    The IP address of the machine hosting the session.

  • IsAnonymousUser (System.Boolean)

    Indicates whether the session was established anonymously (without user credentials), in this case a temporary local user account on the machine is used.

  • IsPhysical (System.Boolean)

    This value is false if the machine hosting the session can be power managed, and true otherwise

  • LaunchedViaHostName (System.String)

    The host name of the StoreFront server used to launch the session. This is blank if the session was launched via Workspace.

  • LaunchedViaIP (System.String)

    The IP address of the StoreFront server used to launch the session. This is blank if the session was launched via Workspace.

  • LaunchedViaPublishedName (System.String)

    The published name of the resource originally used to launch the session. This is the name selected by the user in Receiver. For application sessions this is the name of the first application launched into the session even if that application has since terminated. The name here does not change if the resource is later renamed or removed.

  • LaunchedViaWorkspace (System.Boolean?)

    Indicates whether the session was launched via Citrix Workspace.

  • LogoffInProgress (System.Boolean)

    Indicates whether the session is in the process of being logged off.

  • LogonInProgress (System.Boolean)

    Indicates whether the session is still executing user logon processing or not.

  • MachineName (System.String)

    DNS host name of the machine hosting the session.

  • MachineSummaryState (Citrix.Broker.Admin.SDK.DesktopSummaryState)

    The summary state of the machine (will be Unregistered, Disconnected, or InUse)

  • MachineUid (System.Int32)

    UID of the machine hosting the session.

  • MetadataMap (System.Collections.Generic.Dictionary<string, string>)

    Map of metadata for this session.

  • OSType (System.String)

    A string that can be used to identify the operating system that is running on the machine hosting the session.

  • PersistUserChanges (Citrix.Broker.Admin.SDK.PersistUserChanges)

    Describes whether/how the user changes are persisted. Possible values are:

    • OnLocal - Persist the user changes locally.
    • Discard - Discard user changes.
  • PowerState (Citrix.Broker.Admin.SDK.PowerState)

    The current power state of the machine hosting the session. Possible values are: Unmanaged, Unknown, Unavailable, On, Suspended, TurningOn, TurningOff, Suspending and Resuming.

  • PreferredZoneName (System.String)

    The name of preferred zone used for the original session launch. This may differ from the actual ZoneName if no resources were available in the preferred zone at launch time.

  • PreferredZoneUid (System.Guid?)

    The UID of preferred zone used for the original session launch. This may differ from the actual ZoneUid if no resources were available in the preferred zone at launch time.

  • Protocol (System.String)

    The protocol that the session is using, can be HDX, RDP, or Console. Console sessions on XenDesktop 5 VDAs appear with a blank protocol.

  • ProvisioningType (Citrix.Broker.Admin.SDK.ProvisioningType)

    Describes how the machine hosting the session was provisioned, possible values are:

    • Manual: No provisioning.
    • PVS: Machine provisioned by PVS (may be physical, blade, VM,…)
    • MCS: Machine provisioned by MCS (machine must be VM)
  • ReceiverIPAddress (System.String)

    The IP address of the client as supplied by Receiver (for example, StoreFront) when the session was launched, or reconnected.

  • ReceiverName (System.String)

    The name of the client as supplied by Receiver (for example, StoreFront) when the session was launched, or reconnected.

  • SecureIcaActive (System.Boolean?)

    Indicates whether SecureICA is active on the session.

  • SessionId (System.Int32)

    Deprecated. A unique identifier that Remote Desktop Services uses to track the session but it is only unique on that machine.

  • SessionKey (System.Guid)

    GUID that provides a unique identifier for this session.

  • SessionReconnection (Citrix.Broker.Admin.SDK.SessionReconnection?)

    Describes the session reconnection (roaming) behavior for this session. Possible values are: Always, DisconnectedOnly, and SameEndpointOnly.

  • SessionState (Citrix.Broker.Admin.SDK.SessionState)

    The state of the session. Valid values are Connected, Active or Disconnected. For a session on a machine with functional level below L7, the additional states PreparingSession, Reconnecting, NonBrokeredSession, Other, and Unknown can also occur.

  • SessionStateChangeTime (System.DateTime)

    The time of the most recent state change for the session.

  • SessionSupport (Citrix.Broker.Admin.SDK.SessionSupport)

    Indicates if the machine hosting the session supports multiple or single sessions.

  • SessionType (Citrix.Broker.Admin.SDK.SessionType)

    Indicates if this is an Application or Desktop session.

  • SmartAccessTags (System.String[])

    The Smart Access tags for this session.

  • StartTime (System.DateTime?)

    Indicates when the session was started.

  • TenantId (System.Guid?)

    The tenant associated with the session.

  • Uid (System.Int64)

    Unique identifier of this session.

  • UntrustedUserName (System.String)

    The name of the logged-on user reported directly from the machine (in the form DOMAIN\user). This may be useful where the user is logged in to a non-domain account, however the name cannot be verified and must therefore be considered untrusted.

  • UserFullName (System.String)

    The full name of the user.

  • UserName (System.String)

    The name of the user.

  • UserSID (System.String)

    The user’s Windows SID.

  • UserUPN (System.String)

    The user’s User Principal Name

  • ZoneName (System.String)

    The name of zone in which the machine hosting the session is located.

  • ZoneUid (System.Guid)

    The UID of the zone in which the machine hosting the session is located.

Examples

EXAMPLE 1

Enumerate all sessions.

Get-BrokerSession
<!--NeedCopy-->

EXAMPLE 2

Get all disconnected sessions for a specific user.

Get-BrokerSession -UserName MyDomain\MyAccount -SessionState Disconnected
<!--NeedCopy-->

Parameters

-Uid

Get session by its Uid.

Type: Int64
Position: 2
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-SessionKey

Gets session having the specified unique key.

Type: Guid
Position: 2
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-AgentVersion

Gets sessions with a specific Virtual Desktop Agent version.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-AnonymousUserId

Gets anonymous session associated with the specified user ID.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-ApplicationInUse

Gets sessions running specific applications (identified by their SDK Name property).

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-AppState

Get sessions by their app state.

Valid values are PreLogon, PreLaunched, Active, Desktop, Lingering and NoApps.

Type: SessionAppState
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-AppStateLastChangeTime

Get sessions by their app state change time.

Type: DateTime
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-AutonomouslyBrokered

Gets sessions according to whether they are autonomously brokered or not. Autonomously brokered sessions are HDX sessions established by direct connection without being brokered.

Type: Boolean
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-BrokeringDuration

Gets session with a specific time taken to broker. In general, Citrix recommends using -Filter and relative comparisons.

Type: Int32
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-BrokeringTime

Get sessions brokered at a specific time. In general, Citrix recommends using -Filter and relative comparisons.

Type: DateTime
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-BrokeringUserName

Get sessions by brokering user.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-BrokeringUserSID

Get sessions by brokering user SID.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-CatalogName

Gets sessions on machines from a specific catalog name.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-CbpVersion

The version of CBP that the VDA is currently registered with. This will be null when the VDA is not registered.

Type: CBPVersion
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-ClientAddress

Get sessions by client IP address.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-ClientName

Get sessions by client name.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-ClientPlatform

Get sessions by client platform.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-ClientProductId

Get sessions by client product ID.

Type: Int32
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-ClientVersion

Get sessions by client version.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-ConnectedViaHostName

Get sessions by host name of the incoming connection. This is usually a proxy or Citrix Access Gateway server.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-ConnectedViaIP

Get sessions by IP address of the incoming connection.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-ConnectionMode

Gets sessions by the way in which the most recent connection to the session was established.

Valid modes are Brokered, Unbrokered, LeasedConnection, VdaHighAvailabilityMode, ThirdPartyBroker, and ThirdPartyBrokerWithLicensing.

Type: ConnectionMode
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-ControllerDNSName

Gets sessions that are hosted on machines which are registered with a specific controller.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-DesktopGroupName

Gets sessions from a desktop group with the specified name.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-DesktopGroupUid

Gets sessions from a desktop group with the specified UID.

Type: Int32
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-DesktopKind

Gets sessions on a desktop of a particular kind.

Valid values are Private and Shared.

Type: DesktopKind
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-DesktopSID

Get sessions by desktop SID.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-DesktopUid

Get sessions by desktop Uid.

Type: Int32
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-DeviceId

Get sessions by client device id.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-DNSName

Gets sessions by their machine’s DNS name.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-EntitlementPolicyRuleUid

Gets sessions where the user was granted the entitlement to launch the session from the specified entitlement policy rule.

Type: Int32
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-EstablishmentDuration

Gets sessions which took a specific time to establish. In general, Citrix recommends using -Filter and relative comparisons.

Type: Int32
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-EstablishmentTime

Gets sessions which became established at a particular time. In general, Citrix recommends using -Filter and relative comparisons.

Type: DateTime
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-HardwareId

Get sessions by client hardware id.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-Hidden

Get sessions by whether they are hidden or not. Hidden sessions are treated as though they do not exist when brokering sessions; a hidden session cannot be reconnected to, but a new session may be launched using the same entitlement.

Type: Boolean
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-HostedMachineName

Gets sessions by their machine’s name as known to its hypervisor.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-HostingServerName

Gets sessions hosted by a machine with a specific name of the hosting hypervisor server.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-HypervisorConnectionName

Gets sessions hosted by a machine with a specific name of the hosting hypervisor connection.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-IdleDuration

Gets sessions that have been idle for the specified period

Type: TimeSpan
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-IdleSince

Time at which session went idle

Type: DateTime
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-ImageOutOfDate

Gets sessions hosted by a machine with a specific ImageOutOfDate setting.

Type: Boolean
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-InMaintenanceMode

Gets sessions hosted by a machine with a specific InMaintenanceMode setting.

Type: Boolean
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-IPAddress

Gets sessions hosted by a machine with a specific IP address.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-IsAnonymousUser

Gets sessions depending on whether they were established anonymously ($true) or not ($false). An anonymous session is established without user credentials and a temporary local user account is used.

Type: Boolean
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-IsPhysical

Gets sessions hosted on machines where the flag indicating if the machine can be power managed by the Citrix Broker Service matches the requested value. Where the power state of the machine cannot be controlled, specify $true, otherwise $false.

Type: Boolean
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-LaunchedViaHostName

Get sessions by the host name of the StoreFront server from which a user launches a session.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-LaunchedViaIP

Get sessions by the IP address of the StoreFront server from which a user launches a session.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-LaunchedViaPublishedName

Gets sessions originally launched using a resource having a name matching the specified published name.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-LaunchedViaWorkspace

Gets sessions by whether they were launched via Citrix Workspace or not.

Type: Boolean
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-LogoffInProgress

Gets sessions by whether they are in the process of being logged off or not.

Type: Boolean
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-LogonInProgress

Gets sessions by whether they are still executing user logon processing or not.

Type: Boolean
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-MachineName

Gets sessions by their machine name (in the form DOMAIN\machine).

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-MachineSummaryState

Gets sessions on a machine with a specific summary state.

Valid values are Off, Unregistered, Available, Disconnected, Preparing, and InUse.

Type: DesktopSummaryState
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-MachineUid

Gets sessions on a machine with the specified UID.

Type: Int32
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-Metadata

Gets records with matching metadata entries.

The value being compared with is a concatenation of the key name, a colon, and the value. For example: -Metadata “abc:x*” matches records with a metadata entry having a key name of “abc” and a value starting with the letter “x”.

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

-OSType

Gets sessions with a specific type of operating system.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-PersistUserChanges

Gets sessions where the user changes are persisted in a particular manner. Values can be:

  • OnLocal - User changes are persisted locally.
  • Discard - User changes are discarded.
Type: PersistUserChanges
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-PowerState

Gets sessions on machines in the specified power state.

Valid values are Unmanaged, Unknown, Unavailable, On, Suspended, TurningOn, TurningOff, Suspending, and Resuming.

Type: PowerState
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-PreferredZoneName

Gets sessions originally launched with the specified preferred zone name.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-PreferredZoneUid

Gets sessions originally launched with the specified preferred zone Uid.

Type: Guid
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-Protocol

Get sessions by connection protocol. Valid values are HDX, RDP, or Console.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-ProvisioningType

Gets sessions hosted on machines provisioned in a particular manner. Values can be:

  • Manual - No automated provisioning.
  • PVS - Machine provisioned by PVS (machine may be physical, blade, VM,…).
  • MCS - Machine provisioned by MCS (machine must be VM).
Type: ProvisioningType
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-ReceiverIPAddress

Gets sessions with the specified client IP address supplied by Receiver (for example, StoreFront) when the session was launched, or reconnected.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-ReceiverName

Gets sessions with the specified client name supplied by Receiver (for example, StoreFront) when the session was launched, or reconnected.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-SecureIcaActive

Get sessions by their use of SecureICA.

Type: Boolean
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-SessionId

Deprecated.

Gets sessions by session ID, a unique identifier that Remote Desktop Services uses to track the session but it is only unique on that machine.

Type: Int32
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-SessionReconnection

Get sessions by their session reconnection (roaming) behavior. Possible values are:

Always, DisconnectedOnly, and SameEndpointOnly.

Type: SessionReconnection
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-SessionState

Get sessions by their state.

Valid values are Other, PreparingNewSession, Connected, Active, Disconnected, Reconnecting, NonBrokeredSession, and Unknown.

Type: SessionState
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-SessionStateChangeTime

Get sessions by their last state change time. In general, Citrix recommends using -Filter and relative comparisons.

Type: DateTime
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-SessionSupport

Gets sessions hosted on machines which support the required pattern of sessions. Values can be:

  • SingleSession - Single-session only machine.
  • MultiSession - Multi-session capable machine.
Type: SessionSupport
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-SessionType

Get sessions by their type.

Valid values are Application and Desktop.

Type: SessionType
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-StartTime

Get sessions by their start time. In general, Citrix recommends using -Filter and relative comparisons.

Type: DateTime
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-TenantId

Gets sessions associated with the specified tenant.

Type: Guid
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-UntrustedUserName

Gets sessions by the untrusted user name reported directly from the machine (in the form DOMAIN\user).

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-UserFullName

Gets sessions by user’s full name (usually ‘first-name last-name’).

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-UserName

Get sessions by user name (in the form DOMAIN\user).

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-UserSID

Get sessions by user’s Windows SID.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-UserUPN

Gets sessions by user’s User Principal Name (in the form user@domain).

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-ZoneName

Gets sessions hosted on machines located in the zone with the specified name.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-ZoneUid

Gets sessions hosted on machines located in the zone with the specified UID.

Type: Guid
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-ApplicationUid

Get sessions running the application with the specified Uid.

Type: Int32
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-SharedDesktopUid

Get sessions by SharedDesktop Uid.

Type: Int32
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-ReturnTotalRecordCount

When specified, this causes the cmdlet to output an error record containing the number of records available. This error record is additional information and does not affect the objects written to the output pipeline. See about_Broker_Filtering for details.

Type: SwitchParameter
Position: Named
Default value: False
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-MaxRecordCount

Specifies the maximum number of records to return.

Type: Int32
Position: Named
Default value: 250
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-Skip

Skips the specified number of records before returning results. Also reduces the count returned by -ReturnTotalRecordCount.

Type: Int32
Position: Named
Default value: 0
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-SortBy

Sorts the results by the specified list of properties. The list is a set of property names separated by commas, semi-colons, or spaces. Optionally, prefix each name with a + or - to indicate ascending or descending order. Ascending order is assumed if no prefix is present.

Type: String
Position: Named
Default value: The default sort order is by name or unique identifier.
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-Filter

Gets records that match a PowerShell style filter expression. See about_Broker_Filtering for details.

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

-FilterScope

Gets only results allowed by the specified scope id.

Type: Guid
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-Property

Specifies the properties to be returned. This is similar to piping the output of the command through Select-Object, but the properties are filtered more efficiently at the server.

Type: String[]
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

CitrixCommonParameters

This cmdlet supports the common Citrix parameters: -AdminAddress, -AdminClientIP, -BearerToken, -TraceParent, -TraceState and -VirtualSiteId. For more information, see about_CitrixCommonParameters.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

You cannot pipe input into this cmdlet.

Outputs

Citrix.Broker.Admin.SDK.Session

Returns sessions matching the specified criteria.

Get-BrokerSession