Most of information available here also available in the tool itself (type '?' when in command mode) although it is a little less readable.

Commands

Notes

When working with private local queues, short version of fully qualified name can be used, for example:
Instead of
copy /s .\private$\sourceQueue /d .\private$\destinationQueue, or
send /p .\private$\dQueue /m text

Same commands can run as following
copy /s sourceQueue /d destinationQueue
send /p dQueue /m text

List command

Format

list [optional:/h [host]] [optional:/u [domain\username]] [optional:/p [password]]

Description

Displays list of public queues on the specified host. If host is not provided displays queues for the local machine. If remote host requires different set of credential they can be provided with /u and /p.

Examples

list
list /h remotehost
list /h remotehost /u workgroup\jdoe /p SuCCeSS$1M!

Create command

Format

create /p [path] [optional:/t]

Description

Creates transactional or non-transactional queue with the specified path.

Examples

create /p .\private$\MSMQStudioQueue
create /p .\private$\MSMQStudioQueue /t

Delete command

Format

delete /p [path]

Description

Deletes queue referenced by path.

Example

delete /p .\private$\MSMQStudioQueue

Purge command

Format

purge /p [path]

Description

Removes ALL messages from the queue referenced by path. Does not ask for confirmation.

Example

 purge /p .\private$\MSMQStudioQueue

Send command

Format

send /p [path] [opitonal: /c [count]] [/m [message] |  /f [filepath]]

Description

Sends message in the queue referenced by path. With either text entered after "/m" or read from file referenced by filepath. Double quote escaping is not supported at this time. For file "/f" version of command entire file will be sent. If /c parameter was provided message duplicated count times.

Examples

 send /p .\private$\MSMQStudioQueue /m "the text to be sent"
 send /p .\private$\MSMQStudioQueue /f \\folder01\file01.ext
 send /p .\public$\MSMQStudioQueue /c 5 /f X:\folder01\file01.ext

Peek command

Format

peek /p [path] [optional: /c [count]]

Description

Displays body of the count messages referenced by path, does not remove messages from the queue. Operation stops when either end of queue or count were reached. If count was not specified displays ALL messages in the queue.
Be careful with this one, it will take a while to display the messages if there are tens of thousands of them in the queue.

Examples

peek /p .\private$\MSMQStudioQueue /c 5
peek /p FormatName:Direct=TCP:127.0.0.1\private$\MSMQStudioQueue

Copy command

Format

copy /s [source path] /d [destination path]

Description

Copies all messages from source queue to destination queue.

Example

copy /s .\private$\SourceQueue /d .\private$\DestinationQueue

Export command

Format

export /p [path] [optional:/f [filename]]

Description

Exports all messages from source queue to destination file. If name of the file was not provided msmqmng will create new file with the name equal to the queue name adding '.xml' extension. Export command does NOT remove messages from the queue.

Examples

 export /p .\private$\MSMQStudioQueue
 export /p .\private$\MSMQStudioQueue /f C:\QueueData\msmqexport.xml

Import command

Format

import /p [path] [optional:/f [filename]]

Description

Imports all messages from source file to destination queue. If name of the file was not provided msmqmng will search current folder for the file named equally to the queue name with '.xml' extension.

Examples

import /p .\private$\MSMQStudioQueue
import /p .\private$\MSMQStudioQueue /f C:\QueueData\msmqexport.xml

Load command

Format

load /f [filename]

Description

Loads script file and executes all of the commands in it sequentially, if any of the commands fails execution stops.

Example

load /f cmd.txt

Sample content of cmd.txt file
delete /p tempQueue
create /p tempQueue
copy /s prodQueue /d tempQueue

Queue name examples

Example Description
.\MSMQStudioQueue References a public queue MSMQStudioQueue on the local machine.
serverXYZ\MSMQStudioQueue References a public queue on a machine named serverXYZ.
.\private$\MSMQStudioQueue References a private queue named MSMQStudioQueue on the local machine.
serverXYZ\private$\MSMQStudioQueue References a private queue named MSMQStudioQueue on a machine named serverXYZ.
Formatname:DIRECT=OS:.\MSMQStudioQueue References a public queue named MSMQStudioQueue on the local machine.
Formatname:DIRECT=OS:server01\MSMQStudioQueue References a public queue named MSMQStudioQueue on a machine server01.
Formatname:DIRECT=TCP:127.0.0.1\private$\MSMQStudioQueue References a private queue named MSMQStudioQueue on the local machine.

Last edited Sep 11, 2012 at 9:21 PM by SharkFighter, version 13

Comments

No comments yet.