Send-MsmqQueue
Send-MsmqQueue
Sends a test message to the specified queues.
Syntax
Parameter Set: InputObject
Send-MsmqQueue -InputObject <MessageQueue[]> [-AcknowledgeType <AcknowledgeTypes> {None | PositiveArrival | PositiveReceive | NotAcknowledgeReachQueue | FullReachQueue | NegativeReceive | NotAcknowledgeReceive | FullReceive} ] [-AdminQueuePath <String> ] [-Authenticated] [-Body <Object> ] [-Journaling] [-Label <String> ] [-MessageObject <Message> ] [-Recoverable] [-ResponseQueuePath <String> ] [-TimeToBeReceived <TimeSpan> ] [-TimeToReachQueue <TimeSpan> ] [-Transactional] [ <CommonParameters>]
Parameter Set: Name
Send-MsmqQueue [-Name] <String> [-AcknowledgeType <AcknowledgeTypes> {None | PositiveArrival | PositiveReceive | NotAcknowledgeReachQueue | FullReachQueue | NegativeReceive | NotAcknowledgeReceive | FullReceive} ] [-AdminQueuePath <String> ] [-Authenticated] [-Body <Object> ] [-Journaling] [-Label <String> ] [-MessageObject <Message> ] [-Recoverable] [-ResponseQueuePath <String> ] [-TimeToBeReceived <TimeSpan> ] [-TimeToReachQueue <TimeSpan> ] [-Transactional] [ <CommonParameters>]
Detailed Description
The Send-MsmqQueue cmdlet sends a test message to one or more remote queues. Note that the Name parameter accepts path names, format names and direct format names, unlike other MSMQ cmdlets that accept only a friendly name for the queue. The cmdlet sends express messages by default. It returns a System.Messaging.Message object that represents the message sent.
Parameters
-AcknowledgeType<AcknowledgeTypes>
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-AdminQueuePath<String>
Sets the pathname of the queue that receives the acknowledgement messages that Message Queuing generates. Default is empty string.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Authenticated
If specified, the message is sent as an authenticated message.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Body<Object>
The body of the message to be sent to the queue.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-InputObject<MessageQueue[]>
An array of MessageQueue objects that represent the destination queues to which the message will be sent. Accepts pipelined input.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByValue) |
Accept Wildcard Characters? |
false |
-Journaling
If specified, indicates whether a copy of the message should be kept in a machine journal on the originating computer.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Label<String>
A label that describes the message. Default is empty string.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-MessageObject<Message>
A pre-constructed message object can be passed in as pipelined input.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Name<String>
Specifies the name of the queue.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Recoverable
If specified, the message is sent as a recoverable message.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ResponseQueuePath<String>
Sets the pathname of the queue that receives application-generated response messages. Default is empty string.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-TimeToBeReceived<TimeSpan>
Sets the maximum amount of time for the message to be received from the destination queue. Default is 49.17:02:47.295. Alias: TTBR
Aliases |
TTBR |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-TimeToReachQueue<TimeSpan>
Sets the maximum amount of time for the message to reach the queue. Default is 49.17:02:47.295. Alias: TTRQ
Aliases |
TTRQ |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Transactional
If specified, the message is sent as a transactional message. Alias: Xact
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
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 (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Usage Example
PS C:\> Get-MsmqQueue –Name "a04bm10\private$\order_queue" | Send-MsmqQueue –Recoverable –Transactional –AdminQueuePath ".\private$\admin_queue"
Get-MsmqQueue –Name "FormatName:DIRECT=TCP:10.199.37.61\order_queue”"| Send-MsmqQueue –Transactional –Label "From PowerShell"