Get-MsmqQueue

Get-MsmqQueue

This cmdlet returns an array of MsmqQueue objects, each of them representing an existing private, public or system queue.

Syntax

Parameter Set: All
Get-MsmqQueue [[-Name] <String[]> ] [-QueueType <QueueType> ] [ <CommonParameters>]

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

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

Detailed Description

This cmdlet returns an array of MsmqQueue objects, each of them representing an existing private, public or system queue. The queue must be local to the machine on which the cmdlet is executed. Without parameters this cmdlet will return all Public, Private and System Queues of the host machine.

Parameters

-Journal

If specified, retrieves the Journal queue(s) that match the Name parameter.

Aliases

none

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String[]>

The name of a queue. Supports wildcard characters. The default is “*”.

Aliases

none

Required?

false

Position?

1

Default Value

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-QueueType<QueueType>

If specified as PrivateAndPublic, returns all public and private queues that match the –Name parameter.If specified as Private, returns all private queues that match the –Name parameter.If specified as Public, returns all public queues that match the –Name parameter.If specified as SystemDeadLetter, returns all non-transactional dead letter queues that match the –Name parameter.If specified as SystemJournal, returns all system journal queues that match the –Name parameter.If specified as SystemTransactionalDeadLetter, returns all transactional dead letter queues that match the –Name parameter.Default is PrivateAndPublic.

Aliases

none

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SubQueue<String>

If specified, returns the subqueue object for the main queue. If the subqueue doesn’t exist, then one will be created implicitly. The characters ‘?’ and ‘*’ are not interpreted as wildcard characters, but part of the subqueue name.

Aliases

none

Required?

false

Position?

named

Default Value

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

Examples

Usage Scenario

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