Export (0) Print
Expand All

Get-Queue

 

Applies to: Exchange Server 2007 SP3, Exchange Server 2007 SP2, Exchange Server 2007 SP1

Topic Last Modified: 2007-08-29

Use the Get-Queue cmdlet to view configuration information for queues on a computer that has the Hub Transport server role or the Edge Transport server role installed.


Get-Queue [-BookmarkIndex <Int32>] [-BookmarkObject <QueueInfo>] [-Filter <String>] [-IncludeBookmark <$true | $false>] [-ResultSize <Unlimited>] [-ReturnPageInfo <$true | $false>] [-SearchForward <$true | $false>] [-Server <ServerIdParameter>] [-SortOrder <SortOrderEntry[]>]


Get-Queue [-Identity <QueueIdentity>] [-BookmarkIndex <Int32>] [-BookmarkObject <QueueInfo>] [-IncludeBookmark <$true | $false>] [-ResultSize <Unlimited>] [-ReturnPageInfo <$true | $false>] [-SearchForward <$true | $false>] [-SortOrder <SortOrderEntry[]>]

The Get-Queue cmdlet displays information about existing queues on a Hub Transport server or an Edge Transport server. If you provide no parameters, the command queries all queues on the local server and returns a single page of results. The default page size is 1,000 objects. You can display queues on a remote server by including the server name as part of the Identity parameter or by using the Server parameter with a filter query. The Identity parameter and Filter parameter sets are mutually exclusive.

To run the Get-Queue cmdlet, the account you use must be delegated the following:

  • Exchange Server Administrators role

To run the Get-Queue cmdlet on a computer that has the Edge Transport server role installed, you must log on by using an account that is a member of the local Administrators group on that computer.

For more information about permissions, delegating roles, and the rights that are required to administer Microsoft Exchange Server 2007, see Permission Considerations.

 

Parameter Required Type Description

BookmarkIndex

Optional

System.Int32

Use the BookmarkIndex parameter to specify the position in the result set where the displayed results start. The value of this parameter is a 1-based index in the total result set. BookmarkIndex cannot be used with the BookmarkObject parameter.

BookmarkObject

Optional

Microsoft.Exchange.Data.QueueViewer.QueueInfo

Use the BookmarkObject parameter to specify the object in the result set where the displayed results start. BookmarkObject cannot be used with the BookmarkIndex parameter.

Filter

Optional

System.String

The Filter parameter requires an expression that specifies the property value criteria for the queues that you want to display. The expression includes a property name that is followed by a comparison operator and value. The following queue properties are valid criteria for the Filter parameter:

  • DeliveryType   The delivery type for this queue as defined by transport. The delivery type must be one of the following values:

    • DNSConnectorDelivery

    • NonSMTPGatewayDelivery

    • SmartHostConnectorDelivery

    • SmtpRelayWithinAdSitetoEdge

    • MapiDelivery

    • SmtpRelayWithinAdSite

    • SmtpRelaytoRemoteAdSite

    • SmtpRelaytoTiRg

    • Undefined

    • Unreachable

  • Identity   Enter the queue identity in the form of Server\destination, where destination is a remote domain, mailbox server, or persistent queue name.

  • LastError   A text string of the last error recorded for a queue.

  • LastRetryTime   The time when a connection was last tried for this queue.

  • MessageCount   The number of items in the queue.

  • NextHopConnector   The GUID of the connector that was used to create the queue.

  • NextHopDomain   The next hop domain of the queue, specified as a remote Simple Mail Transfer Protocol (SMTP) domain, a server name, the name of an Active Directory site, or a message database (MDB) identifier.

  • NextRetryTime   The time when a connection will next be tried for this queue.

  • Status   The status of the queue. Queue status options are Active, Ready, Retry, or Suspended.

You can specify multiple criteria by using the -and comparison operator. Property values that are not expressed as an integer must be enclosed in quotation marks.

Identity

Optional

Microsoft.Exchange.Data.QueueViewer.QueueIdentity

Use the Identity parameter to specify the identity of the queue that contains the messages that you want to display. Enter the queue identity in the form of Server\destination, where destination is a remote domain, mailbox server, or persistent queue name.

IncludeBookmark

Optional

System.Boolean

Use the IncludeBookmark parameter to specify whether to include the bookmark object when the query results are displayed. The IncludeBookmark parameter is valid when it is used with the BookmarkObject or BookmarkIndex parameter. If you do not specify a value for the IncludeBookmark parameter, the default value of $true is used.

ResultSize

Optional

Microsoft.Exchange.Data.Unlimited

Use the ResultSize parameter to specify the total number of items to display in the result set. The default ResultSize parameter value is set to 1,000. ResultSize supports an unlimited number of results, but Microsoft Exchange limits the result set to 250,000.

ReturnPageInfo

Optional

System.Boolean

The ReturnPageInfo parameter is a hidden parameter. Use it to return information about the total number of results and the index of the first object of the current page. The default value is $false.

SearchForward

Optional

System.Boolean

Use the SearchForward parameter to specify whether to search forward or backward in the result set. The default value is $true. This value causes the result page to be calculated forward from either the start of the result set or forward from a bookmark if specified.

Server

Optional

Microsoft.Exchange.Configuration.Tasks.ServerIdParameter

Use the Server parameter to specify the name of the server to connect to by using remote procedure call (RPC) that contains the queues that hold the messages that you want to display. Enter the server name as a host name or a fully qualified domain name (FQDN). If the Server parameter is not used, the local server is queried.

SortOrder

Optional

Microsoft.Exchange.Configuration.Tasks.SortOrderEntry[]

Use the SortOrder parameter to specify an array of message properties that are used to control the sort order of the result set. Separate each property by using a comma. Append a + symbol to the beginning of the property name to display the results in ascending order. Append a - symbol to the beginning of the property name to display the results in descending order. If you do not specify a sort order, the result set is displayed in ascending order by QueueIdentity.

 

Error Description

 

 

The following example shows three Get-Queue commands. The first command shows how to display the configuration information for all queues on the Hub Transport server or the Edge Transport server on which the command is run. The command is piped to the Format-List command to format the results as a detailed list.

The second command shows how to display the configuration information for only queues that contain more than 100 messages.

The third command shows how to display the configuration information for a queue that exists on a remote server.

For more information about pipelining, see Pipelining.

For more information about how to work with the output of a command, see Working with Command Output.

For more information about how to use the Exchange Management Shell to perform queue viewer tasks, see Using the Exchange Management Shell to Manage Queues.

Get-Queue | format-list
Get-Queue -Filter {MessageCount -gt 100}
Get-Queue -Identity Server1\contoso.com
 
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft