Edit

Share via


Get-MsmqQueue

Gets message queues.

Syntax

All (Default)

Get-MsmqQueue
    [[-Name] <String[]>]
    [-QueueType <QueueType>]
    [<CommonParameters>]

Journal

Get-MsmqQueue
    [[-Name] <String[]>]
    [-QueueType <QueueType>]
    [-Journal]
    [<CommonParameters>]

SubQueue

Get-MsmqQueue
    [[-Name] <String[]>]
    [-QueueType <QueueType>]
    [-SubQueue <String>]
    [<CommonParameters>]

Description

The Get-MsmqQueue cmdlet gets an array of MsmqQueue objects. Each MsmqQueue object represents an existing private, public, or system queue. This cmdlet gets queues that are local to the computer where you run the cmdlet. If you do not specify parameters, this cmdlet gets all public, private, and system queues of the host computer.

Examples

Example 1: Get public, private, and system queues

PS C:\> Get-MsmqQueue

This command gets public, private, and system queues for the host computer.

Example 2: Get private queues

PS C:\> Get-MsmqQueue -Name "Order*" -QueueType Private

This command gets private queues that have names that start with the string Order for the host computer.

Example 3: Get private Journal queues

PS C:\> Get-MsmqQueue -Name "Order*" -Journal -QueueType Private

This command gets private Journal queues that have names that start with the string Order for the host computer.

Example 4: Get system Journal queues

PS C:\> Get-MsmqQueue -QueueType SystemJournal

This command gets system Journal queues for the host computer.

Example 5: Get all local queues and their message count

PS C:\> Get-MsmqQueue | Select QueueName, MessageCount

This command lists the message count for all queues on the host computer.

Parameters

-Journal

Indicates that this cmdlet retrieves the Journal queue or queues that match the Name parameter.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Journal
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies an array of names of queues. This parameter accepts wildcard characters. The default value is *.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-QueueType

Specifies a queue type. The acceptable values for this parameter are:

  • PrivateAndPublic. The cmdlet gets public and private queues that match the Name parameter.
  • Private. The cmdlet gets private queues that match the Name parameter.
  • Public. The cmdlet gets public queues that match the Name parameter.
  • SystemDeadLetter. The cmdlet gets non-transactional dead-letter queues that match the Name parameter.
  • SystemJournal. The cmdlet gets system journal queues that match the Name parameter.
  • SystemTransactionalDeadLetter. The cmdlet gets transactional dead-letter queues that match the Name parameter.

The default value is PrivateAndPublic.

Parameter properties

Type:QueueType
Default value:None
Accepted values:PrivateAndPublic, Private, Public, SystemJournal, SystemDeadLetter, SystemTransactionalDeadLetter
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SubQueue

Specifies a subqueue object to get for the main queue. If the subqueue does not exist, the cmdlet creates it implicitly. The question mark (?) and asterisk (*) are not interpreted as wildcard characters, but as part of the subqueue name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SubQueue
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

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

Inputs

String

Outputs

Object