Product Documentation

Group-BrokerDesktop

Nov 06, 2015

Groups and counts desktops with the same value for a specified property.

Syntax

Group-BrokerDesktop [-Uid] <Int32> -Property <String> [-AdminAddress <String>] [<CommonParameters>]

Group-BrokerDesktop -Property <String> [[-MachineName] <String>] [-AgentVersion <String>] [-ApplicationInUse <String>] [-AssignedClientName <String>] [-AssignedIPAddress <String>] [-AssociatedUserFullName <String>] [-AssociatedUserName <String>] [-AssociatedUserUPN <String>] [-AutonomouslyBrokered <Boolean>] [-CatalogName <String>] [-CatalogUid <Int32>] [-ClientAddress <String>] [-ClientName <String>] [-ClientVersion <String>] [-ColorDepth <ColorDepth>] [-ConnectedViaHostName <String>] [-ConnectedViaIP <String>] [-ControllerDNSName <String>] [-DeliveryType <DeliveryType>] [-Description <String>] [-DesktopCondition <String>] [-DesktopGroupName <String>] [-DesktopGroupUid <Int32>] [-DesktopKind <DesktopKind>] [-DeviceId <String>] [-DNSName <String>] [-FunctionalLevel <FunctionalLevel>] [-HardwareId <String>] [-HostedMachineId <String>] [-HostedMachineName <String>] [-HostingServerName <String>] [-HypervisorConnectionName <String>] [-HypervisorConnectionUid <Int32>] [-IconUid <Int32>] [-ImageOutOfDate <Boolean>] [-InMaintenanceMode <Boolean>] [-IPAddress <String>] [-IsAssigned <Boolean>] [-IsPhysical <Boolean>] [-LastConnectionFailure <ConnectionFailureReason>] [-LastConnectionTime <DateTime>] [-LastConnectionUser <String>] [-LastDeregistrationReason <DeregistrationReason>] [-LastDeregistrationTime <DateTime>] [-LastErrorReason <String>] [-LastErrorTime <DateTime>] [-LastHostingUpdateTime <DateTime>] [-LaunchedViaHostName <String>] [-LaunchedViaIP <String>] [-MachineInternalState <MachineInternalState>] [-MachineUid <Int32>] [-OSType <String>] [-OSVersion <String>] [-PersistUserChanges <PersistUserChanges>] [-PowerActionPending <Boolean>] [-PowerState <PowerState>] [-Protocol <String>] [-ProvisioningType <ProvisioningType>] [-PublishedApplication <String>] [-PublishedName <String>] [-PvdStage <PvdStage>] [-RegistrationState <RegistrationState>] [-SecureIcaActive <Boolean>] [-SecureIcaRequired <Boolean>] [-SessionHidden <Boolean>] [-SessionId <Int32>] [-SessionState <SessionState>] [-SessionStateChangeTime <DateTime>] [-SessionUid <Int64>] [-SessionUserName <String>] [-SessionUserSID <String>] [-SID <String>] [-SmartAccessTag <String>] [-StartTime <DateTime>] [-SummaryState <DesktopSummaryState>] [-Tag <String>] [-WillShutdownAfterUse <Boolean>] [-ApplicationUid <Int32>] [-ReturnTotalRecordCount] [-MaxRecordCount <Int32>] [-Skip <Int32>] [-SortBy <String>] [-Filter <String>] [-AdminAddress <String>] [<CommonParameters>]

Detailed Description

This cmdlet is now deprecated, please use Group-BrokerMachine.

Filters desktops using the specified criteria, then groups and counts matching desktops with the same value for a particular property. The number of desktops in the group, and the property value for the group, is output. For example:

C:\PS> Group-BrokerDesktop -Property SummaryState

Count Name

----- ----

43 Available

17 InUse

3 Disconnected

Filtering supports the same options as the Get-BrokerDesktop cmdlet, and allows filtering on both desktop and session properties.

Group-BrokerDesktop is similar to the standard PowerShell Group-Object, but is faster than piping the output of Get-BrokerDesktop into Group-Object when working with many desktops.

Note that all session information properties for multi-session desktops is always $null, this means that is is not possible to group these desktops by session information using this command. Use Get-BrokerSession to get information on all current sessions.

Also note that the MaxRecordCount, ReturnTotalRecordCount, Skip, and SortBy parameters apply to GroupInfo records output rather than the filtered desktops.

Related topics

Get-BrokerDesktop

Group-Object

Parameters

-Uid<Int32>

Gets desktops with a specific UID.

Required? true
Default Value  
Accept Pipeline Input? false

-Property<String>

Selects the property by which matching desktops are grouped.

Required? true
Default Value  
Accept Pipeline Input? false

-MachineName<String>

Gets desktops with a specific machine name (in the form 'domain\machine').

Required? false
Default Value  
Accept Pipeline Input? false

-AgentVersion<String>

Gets desktops with a specific Citrix Virtual Delivery Agent version.

Required? false
Default Value  
Accept Pipeline Input? false

-ApplicationInUse<String>

Gets desktops running a specified published application (identified by browser name).

String comparisons are case-insensitive.

Required? false
Default Value  
Accept Pipeline Input? false

-AssignedClientName<String>

Gets desktops assigned to a specific client name.

Required? false
Default Value  
Accept Pipeline Input? false

-AssignedIPAddress<String>

Gets desktops assigned to a specific IP address.q

Required? false
Default Value  
Accept Pipeline Input? false

-AssociatedUserFullName<String>

Gets desktops with an associated user identified by their full name (usually in the form 'first-name last-name').

Associated users are the current user for shared desktops, and the assigned users for private desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-AssociatedUserName<String>

Gets desktops with an associated user identified by their user name (in the form 'domain\user').

Associated users are the current user for shared desktops, and the assigned users for private desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-AssociatedUserUPN<String>

Gets desktops with an associated user identified by their User Principle Name (in the form 'user@domain').

Associated users are the current user for shared desktops, and the assigned users for private desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-AutonomouslyBrokered<Boolean>

Gets desktops with the autonomously brokered session flag.

Session properties are always $null for multi-session desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-CatalogName<String>

Gets desktops from the catalog with the specific name.

Required? false
Default Value  
Accept Pipeline Input? false

-CatalogUid<Int32>

Gets desktops from a catalog with a specific UID.

Required? false
Default Value  
Accept Pipeline Input? false

-ClientAddress<String>

Gets desktops with a specific client IP address.

Required? false
Default Value  
Accept Pipeline Input? false

-ClientName<String>

Gets desktops with a specific client name.

Required? false
Default Value  
Accept Pipeline Input? false

-ClientVersion<String>

Gets desktops with a specific client version.

Required? false
Default Value  
Accept Pipeline Input? false

-ColorDepth<ColorDepth>

Gets desktops configured with a specific color depth.

Valid values are FourBit, EightBit, SixteenBit, and TwentyFourBit.

Required? false
Default Value  
Accept Pipeline Input? false

-ConnectedViaHostName<String>

Gets desktops with a specific host name of the incoming connection. This is usually a proxy or Citrix Access Gateway server.

Required? false
Default Value  
Accept Pipeline Input? false

-ConnectedViaIP<String>

Gets desktops with a specific IP address of the incoming connection.

Required? false
Default Value  
Accept Pipeline Input? false

-ControllerDNSName<String>

Gets desktops with a specific DNS name of the controller they are registered with.

Required? false
Default Value  
Accept Pipeline Input? false

-DeliveryType<DeliveryType>

Gets desktops of a particular delivery type.

Valid values are AppsOnly, DesktopsOnly, DesktopsAndApps

Required? false
Default Value  
Accept Pipeline Input? false

-Description<String>

Get desktops with a specific description.

Required? false
Default Value  
Accept Pipeline Input? false

-DesktopCondition<String>

Gets desktop with an outstanding desktop condition condition.

Valid values are:

o CPU: Indicates the machine has high CPU usage

o ICALatency: Indicates the network latency is high

o UPMLogonTime: Indicates that the profile load time was high

Required? false
Default Value  
Accept Pipeline Input? false

-DesktopGroupName<String>

Gets desktops from a desktop group with the specified name.

Required? false
Default Value  
Accept Pipeline Input? false

-DesktopGroupUid<Int32>

Gets desktops from a desktop group with the specified UID.

Required? false
Default Value  
Accept Pipeline Input? false

-DesktopKind<DesktopKind>

Deprecated: Use AllocationType parameter.

Gets desktops of a particular kind.

Valid values are Private, Shared.

Required? false
Default Value  
Accept Pipeline Input? false

-DeviceId<String>

Gets desktops with a specific client device ID.

Required? false
Default Value  
Accept Pipeline Input? false

-DNSName<String>

Get desktops with a specific DNS name.

Required? false
Default Value  
Accept Pipeline Input? false

-FunctionalLevel<FunctionalLevel>

Gets desktops with a specific FunctionalLevel.

Valid values are L5, L7

Required? false
Default Value  
Accept Pipeline Input? false

-HardwareId<String>

Gets desktops with a specific client hardware ID.

Required? false
Default Value  
Accept Pipeline Input? false

-HostedMachineId<String>

Gets desktops with a specific machine ID known to the hypervisor.

Required? false
Default Value  
Accept Pipeline Input? false

-HostedMachineName<String>

Gets desktops with a specific machine name known to the hypervisor.

Required? false
Default Value  
Accept Pipeline Input? false

-HostingServerName<String>

Gets desktops with a specific name of the hosting hypervisor server.

Required? false
Default Value  
Accept Pipeline Input? false

-HypervisorConnectionName<String>

Gets desktops with a specific name of the hosting hypervisor connection.

Required? false
Default Value  
Accept Pipeline Input? false

-HypervisorConnectionUid<Int32>

Gets desktops with a specific UID of the hosting hypervisor connection.

Required? false
Default Value  
Accept Pipeline Input? false

-IconUid<Int32>

Gets desktops with a specific configured icon. Note that desktops with a null IconUid use the icon of the desktop group.

Required? false
Default Value  
Accept Pipeline Input? false

-ImageOutOfDate<Boolean>

Gets desktops if they have an ImageOutOfDate flag.

Required? false
Default Value  
Accept Pipeline Input? false

-InMaintenanceMode<Boolean>

Gets desktops with a specific InMaintenanceMode setting.

Required? false
Default Value  
Accept Pipeline Input? false

-IPAddress<String>

Gets desktops with a specific IP address.

Required? false
Default Value  
Accept Pipeline Input? false

-IsAssigned<Boolean>

Gets desktops according to whether they are assigned or not. Desktops may be assigned to one or more users or groups, a client IP address or a client endpoint name.

Required? false
Default Value  
Accept Pipeline Input? false

-IsPhysical<Boolean>

Specifies if machines in the catalog can be power managed by the Citrix Broker Service. Where the power state of the machine cannot be controlled, specify $true, otherwise $false. Can only be specified together with a provisioning type of Pvs or Manual, or if used with the deprecated CatalogKind parameter only with Pvs or PvsPvd catalog kinds.

Required? false
Default Value  
Accept Pipeline Input? false

-LastConnectionFailure<ConnectionFailureReason>

Gets desktops with a specific reason for the last recorded connection failure. This value is None if the last connection was successful or if there has been no attempt to connect to the desktop yet.

Valid values are None, SessionPreparation, RegistrationTimeout, ConnectionTimeout, Licensing, Ticketing, and Other.

Required? false
Default Value  
Accept Pipeline Input? false

-LastConnectionTime<DateTime>

Gets desktops that last connected at a specific time. This is the time that the broker detected that the connection attempt either succeeded or failed.

Required? false
Default Value  
Accept Pipeline Input? false

-LastConnectionUser<String>

Gets desktops where a specific user name last attempted a connection (in the form 'domain\user').

Required? false
Default Value  
Accept Pipeline Input? false

-LastDeregistrationReason<DeregistrationReason>

Gets desktops whose broker last recorded a specific deregistration reason.

Valid values are $null, AgentShutdown, AgentSuspended, AgentRequested, IncompatibleVersion, AgentAddressResolutionFailed, AgentNotContactable, AgentWrongActiveDirectoryOU, EmptyRegistrationRequest, MissingRegistrationCapabilities, MissingAgentVersion, InconsistentRegistrationCapabilities, NotLicensedForFeature, UnsupportedCredentialSecurityVersion, InvalidRegistrationRequest, SingleMultiSessionMismatch, FunctionalLevelTooLowForCatalog, FunctionalLevelTooLowForDesktopGroup, PowerOff, DesktopRestart, DesktopRemoved, AgentRejectedSettingsUpdate, SendSettingsFailure, SessionAuditFailure, SessionPrepareFailure, ContactLost, SettingsCreationFailure, UnknownError and BrokerRegistrationLimitReached.

Required? false
Default Value  
Accept Pipeline Input? false

-LastDeregistrationTime<DateTime>

Gets desktops that were last deregistered by a specific time.

Required? false
Default Value  
Accept Pipeline Input? false

-LastErrorReason<String>

Gets desktops with the specified last error reason.

Required? false
Default Value  
Accept Pipeline Input? false

-LastErrorTime<DateTime>

Gets desktops with the specified last error time.

Required? false
Default Value  
Accept Pipeline Input? false

-LastHostingUpdateTime<DateTime>

Gets desktops with a specific time that the hosting information was last updated.

Required? false
Default Value  
Accept Pipeline Input? false

-LaunchedViaHostName<String>

Gets desktops with a specific host name of the StoreFront server from which the user launched the session.

Session properties are always $null for multi-session desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-LaunchedViaIP<String>

Gets desktops with a specific IP address of the StoreFront server from which the user launched the session.

Session properties are always $null for multi-session desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-MachineInternalState<MachineInternalState>

Gets desktops with the specified internal machine state.

Required? false
Default Value  
Accept Pipeline Input? false

-MachineUid<Int32>

Gets desktops with a specific machine UID.

Required? false
Default Value  
Accept Pipeline Input? false

-OSType<String>

Gets desktops by the type of operating system they are running.

Required? false
Default Value  
Accept Pipeline Input? false

-OSVersion<String>

Gets desktops by the version of the operating system they are running.

Required? false
Default Value  
Accept Pipeline Input? false

-PersistUserChanges<PersistUserChanges>

Gets desktops by the location where the user changes are persisted.

o OnLocal - User changes are persisted locally.

o Discard - User changes are discarded.

o OnPvd - User changes are persisted on the Pvd.

Required? false
Default Value  
Accept Pipeline Input? false

-PowerActionPending<Boolean>

Gets desktops with a specific power action pending state.

Valid values are $true or $false.

Required? false
Default Value  
Accept Pipeline Input? false

-PowerState<PowerState>

Gets desktops with a specific power state.

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

Required? false
Default Value  
Accept Pipeline Input? false

-Protocol<String>

Gets desktops with connections using a specific protocol, for example 'HDX', or 'RDP'.

Required? false
Default Value  
Accept Pipeline Input? false

-ProvisioningType<ProvisioningType>

Specifies the provisioning type for the catalog. Values can be:

o Manual - No provisioning.

o PVS - Machine provisioned by PVS (machine may be physical, blade, VM,...).

o MCS - Machine provisioned by MCS (machine must be VM).

Required? false
Default Value  
Accept Pipeline Input? false

-PublishedApplication<String>

Gets desktops with a specific application published on them (identified by its browser name).

Required? false
Default Value  
Accept Pipeline Input? false

-PublishedName<String>

Gets desktops with a specific published name.

Required? false
Default Value  
Accept Pipeline Input? false

-PvdStage<PvdStage>

Gets machines with a specific personal vDisk stage.

Valid values are None, Requested, Starting and Working.

Required? false
Default Value  
Accept Pipeline Input? false

-RegistrationState<RegistrationState>

Gets desktops with a specific registration state.

Valid values are Unregistered, Initializing, Registered and AgentError.

Required? false
Default Value  
Accept Pipeline Input? false

-SecureIcaActive<Boolean>

Gets desktops depending on whether the current session uses SecureICA or not.

Session properties are always $null for multi-session desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-SecureIcaRequired<Boolean>

Gets desktops configured with a particular SecureIcaRequired setting. Note that the desktop setting of $null indicates that the desktop group value is used.

Session properties are always $null for multi-session desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-SessionHidden<Boolean>

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

Session properties are always $null for multi-session desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-SessionId<Int32>

Deprecated.

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

Required? false
Default Value  
Accept Pipeline Input? false

-SessionState<SessionState>

Gets desktops with a specific session state.

Valid values are $null, Other, PreparingSession, Connected, Active, Disconnected, Reconnecting, NonBrokeredSession, and Unknown.

Session properties are always $null for multi-session desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-SessionStateChangeTime<DateTime>

Gets desktops whose sessions last changed state at a specific time.

Session properties are always $null for multi-session desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-SessionUid<Int64>

Gets desktops with a specific session UID ($null for no session).

Session properties are always $null for multi-session desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-SessionUserName<String>

Gets desktops with a specific user name for the current session (in the form 'domain\user').

Session properties are always $null for multi-session desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-SessionUserSID<String>

Gets desktops with a specific SID of the current session user.

Session properties are always $null for multi-session desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-SID<String>

Gets desktops with a specific machine SID.

Required? false
Default Value  
Accept Pipeline Input? false

-SmartAccessTag<String>

Gets desktops where the session has the specific SmartAccess tag.

Session properties are always $null for multi-session desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-StartTime<DateTime>

Gets desktops with a specific session start time.

Session properties are always $null for multi-session desktops.

Required? false
Default Value  
Accept Pipeline Input? false

-SummaryState<DesktopSummaryState>

Gets desktops with a specific summary state.

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

Required? false
Default Value  
Accept Pipeline Input? false

-Tag<String>

Gets desktops with a specific tag.

Required? false
Default Value  
Accept Pipeline Input? false

-WillShutdownAfterUse<Boolean>

Gets desktops depending on whether they shut down after use or not.

Required? false
Default Value  
Accept Pipeline Input? false

-ApplicationUid<Int32>

Gets desktops with a specific published application (identified by its UID).

Required? false
Default Value  
Accept Pipeline Input? false

-ReturnTotalRecordCount<SwitchParameter>

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.

Required? false
Default Value False
Accept Pipeline Input? false

-MaxRecordCount<Int32>

Specifies the maximum number of records to return.

Required? false
Default Value 250
Accept Pipeline Input? false

-Skip<Int32>

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

Required? false
Default Value 0
Accept Pipeline Input? false

-SortBy<String>

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.

Required? false
Default Value The default sort order is by name or unique identifier.
Accept Pipeline Input? false

-Filter<String>

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

Required? false
Default Value  
Accept Pipeline Input? false

-AdminAddress<String>

Specifies the address of a XenDesktop controller that the PowerShell snapin will connect to. This can be provided as a host name or an IP address.

Required? false
Default Value Localhost. Once a value is provided by any cmdlet, this value will become the default.
Accept Pipeline Input? false

Input Type

None You cannot pipe input into this cmdlet.

Return Values

Citrix.Broker.Admin.SDK.GroupInfo

Each GroupInfo object represents one group, and contains the following properties:

-- Count: The count of desktops in this group.

-- Name: The value of the property the desktops were grouped by (as a string).

If you do not specify -SortBy, groups are sorted with the largest count first.

Notes

To compare dates or times, use -Filter and relative comparisons. For more information, see about_Broker_Filtering and the examples.

Examples

-------------------------- EXAMPLE 1 --------------------------

C:\PS> Group-BrokerDesktop -Property SummaryState -DesktopGroupName dg1

Group desktops from the dg1 group by summary state.

-------------------------- EXAMPLE 2 --------------------------

C:\PS> Group-BrokerDesktop -Property LastConnectionFailure -Filter { LastConnectionFailure -ne "None" -and LastConnectionTime -ge '-7' } -MaxRecordCount 1

For desktops where the last connection attempt failed, list the most common reason for failure, ignoring connections that failed over a week ago.

-------------------------- EXAMPLE 3 --------------------------

C:\PS> Group-BrokerDesktop -Property HostingServerName -DesktopCondition ICALatency -SortBy Name

List alphabetically the hypervisor servers hosting desktops that are currently experiencing high network latency.