Get-MsmqMessageQueue

Gets the MSMQ message queue by the given name

Syntax

Get-MsmqMessageQueue [-Name] <String> [-Private] [<CommonParameters>]

Description

Returns a MessageQueue object for the Message Queue with name Name. If one doesn't exist, returns $null.

Because MSMQ handles private queues differently than public queues, you must explicitly tell Get-MsmqMessageQueue the queue you want to get is private by using the Private switch.

Parameters

Name Type Description Required? Pipeline Input Default Value
Name String

The name of the queue to get.

true false
Private SwitchParameter

Is the queue private?

false false False

Return Values

System.Messaging.MessageQueue.

EXAMPLE 1

Get-MsmqMessageQueue -Name LunchQueue

Returns the MessageQueue object for the queue named LunchQueue. It's probably pretty full!

EXAMPLE 2

Get-MsmqMessageQueue -Name TeacherLunchQueue -Private

Returns the MessageQueue object for the teacher's private LunchQueue. They must be medical professors.