< Back

Get-CMsmqMessageQueue

Sun Jan 12, 2020 9:45 pm

NAME Get-CMsmqMessageQueue



SYNOPSIS

Gets the MSMQ message queue by the given name





SYNTAX

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





DESCRIPTION

Returns a [MessageQueue](http://msdn.microsoft.com/en-us/library ... queue.aspx) 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-CMsmqMessageQueue` the queue you want to get is private by using the `Private` switch.





PARAMETERS

-Name <String>

The name of the queue to get.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Private [<SwitchParameter>]

Is the queue private?



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

System.Messaging.MessageQueue.





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



PS C:\\>Get-CMsmqMessageQueue -Name LunchQueue



Returns the [MessageQueue](http://msdn.microsoft.com/en-us/library ... queue.aspx) object for

the queue named LunchQueue. It's probably pretty full!









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



PS C:\\>Get-CMsmqMessageQueue -Name TeacherLunchQueue -Private



Returns the [MessageQueue](http://msdn.microsoft.com/en-us/library ... queue.aspx) object for

the teacher's private LunchQueue. They must be medical professors.











RELATED LINKS