Get-MsmqQueue
Gets message queues.
Syntax
Get-MsmqQueue
[[-Name] <String[]>]
[-QueueType <QueueType>]
[<CommonParameters>]
Get-MsmqQueue
[[-Name] <String[]>]
[-QueueType <QueueType>]
[-Journal]
[<CommonParameters>]
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.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Specifies an array of names of queues. This parameter accepts wildcard characters. The default value is *.
Type: | String[] |
Position: | 0 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | 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.
Type: | QueueType |
Accepted values: | PrivateAndPublic, Private, Public, SystemJournal, SystemDeadLetter, SystemTransactionalDeadLetter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | 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.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
String[]