Edit

Share via


Send-MsmqQueue

Sends a test message to remote queues.

Syntax

Name (Default)

Send-MsmqQueue
    [-Name] <String>
    [-MessageObject <Message>]
    [-Body <Object>]
    [-Label <String>]
    [-Recoverable]
    [-Authenticated]
    [-Journaling]
    [-Transactional]
    [-AcknowledgeType <AcknowledgeTypes>]
    [-AdminQueuePath <String>]
    [-ResponseQueuePath <String>]
    [-TimeToReachQueue <TimeSpan>]
    [-TimeToBeReceived <TimeSpan>]
    [<CommonParameters>]

InputObject

Send-MsmqQueue
    -InputObject <MessageQueue[]>
    [-MessageObject <Message>]
    [-Body <Object>]
    [-Label <String>]
    [-Recoverable]
    [-Authenticated]
    [-Journaling]
    [-Transactional]
    [-AcknowledgeType <AcknowledgeTypes>]
    [-AdminQueuePath <String>]
    [-ResponseQueuePath <String>]
    [-TimeToReachQueue <TimeSpan>]
    [-TimeToBeReceived <TimeSpan>]
    [<CommonParameters>]

Description

The Send-MsmqQueue cmdlet sends a test message to one or more remote queues. This cmdlet accepts values for the Name parameter of path names, format names, and direct format names. Some other Message Queuing (also known as MSMQ) cmdlets require a friendly name for the queue. By default, this cmdlet sends express messages. It returns a System.Messaging.Message object that represents the message sent.

Examples

Example 1: Send a test message to a queue

PS C:\> Get-MsmqQueue -Name "a04bm10\private$\order_queue" | Send-MsmqQueue -AdminQueuePath ".\private$\admin_queue" -Recoverable -Transactional

This command gets a queue that has the specified name by using the Get-MsmqQueue cmdlet. The command passes the results to the current cmdlet by using the pipeline operator. The current cmdlet sends a test message to the queue. The cmdlet specifies properties of the message.

Example 2: Send a test message with a label to a queue

PS C:\> Get-MsmqQueue -Name "FormatName:DIRECT=TCP:10.199.37.61\order_queue" | Send-MsmqQueue -Label "From PowerShell" -Transactional

This command gets a queue that has the specified name by using Get-MsmqQueue. The command passes the results to the current cmdlet by using the pipeline operator. The current cmdlet sends a test message to the queue. The test message has a label.

Parameters

-AcknowledgeType

Specifies the type of acknowledgement messages that can be returned by Messaging Queuing.

Parameter properties

Type:AcknowledgeTypes
Default value:None
Accepted values:None, PositiveArrival, PositiveReceive, NotAcknowledgeReachQueue, FullReachQueue, NegativeReceive, NotAcknowledgeReceive, FullReceive
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AdminQueuePath

Specifies a path. The queue that the path specifies receives the acknowledgement messages that Message Queuing generates.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Authenticated

Indicates that the cmdlet sends the message as an authenticated message.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Body

Specifies the body of the message. The cmdlet sends a message that includes the body that this parameter specifies to the queue.

Parameter properties

Type:Object
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Specifies an array of MessageQueue objects. This cmdlet sends messages to the destination queues that the MessageQueue specify. This parameter accepts pipeline input.

Parameter properties

Type:

MessageQueue[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

InputObject
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Journaling

Indicates that the originating computer keeps a copy of the message in a journal.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Label

Specifies a label. The label that this parameter specifies describes the message. The default value is an empty string.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MessageObject

Specifies a preconstructed message object that you can specify as pipeline input.

Parameter properties

Type:Message
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies a name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Name
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Recoverable

Indicates that the cmdlet sends the message as a recoverable message.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResponseQueuePath

Specifies a path. The queue that this parameter specifies receives application-generated response messages.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TimeToBeReceived

Specifies the maximum amount of time, in milliseconds, for the message to be received from the destination queue. The default value is 49.17:02:47.295.

Parameter properties

Type:TimeSpan
Default value:None
Supports wildcards:False
DontShow:False
Aliases:TTBR

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TimeToReachQueue

Specifies the maximum amount of time, in milliseconds, for the message to reach the queue. The default value is 49.17:02:47.295.

Parameter properties

Type:TimeSpan
Default value:None
Supports wildcards:False
DontShow:False
Aliases:TTRQ

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Transactional

Indicates that this cmdlet sends the message as a transactional message.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.Msmq.PowerShell.Commands.MessageQueue

Outputs

Object