Message Queueing (MSMQ) Cmdlets in Windows PowerShell

S'applique à: Windows 8, Windows Server 2012

This reference provides information about the Windows PowerShell cmdlets provided with Microsoft Message Queue Server (MSMQ). The cmdlet help topics in this section are sorted by verb groups and contains the same help about each topic that you can view in the MSMQ implementation of the Windows PowerShell command by typing:

Get-Help <Cmdlet-Name> -detailed

Using PowerShell cmdlets for clustered instances

To manage a clustered MSMQ instance:

-- Open a local or remote PowerShell session on the machine that hosts an MSMQ cluster.
-- To manage a clustered MSMQ instance, set the following environment variables in a PowerShell session:

$env:computername = “myClusterResourceName”

$env:_Cluster_Network_Hostname_ = “myClusterResourceName”

$env:_Cluster_Network_Name_ = “myClusterResourceName”

If you do not set the environment variables, all MSMQ PowerShell cmdlets run against the local MSMQ instance rather than against a clustered instance.

Once these variables have been set, the session cannot be used to issue commands against the local MSMQ instance by resetting these environment variables. Instead, a new PowerShell session to the clustered machine must be established.

Cmdlet Description

Clear-MsmqOutgoingQueue

Purges all outgoing queues that are represented by the supplied MsmqOutgoingQueue objects.

Clear-MsmqQueue

Purges all queues that are represented by the supplied MsmqOutgoingQueue objects.

Enable-MsmqCertificate

Registers a certificate with Active Directory Domain Services.

Get-MsmqCertificate

Gets an array of type System.Security.Cryptography.X509Certificates.X509Certificate.

Get-MsmqOutgoingQueue

Gets an array of MsmqOutgoingQueue objects, each representing a transactional or non-transactional outgoing queue.

Get-MsmqQueue

Gets an array of MsmqQueue objects, each of them representing an existing private, public or system queue.

Get-MsmqQueueACL

Gets an array of MsmqQueueAcl objects for the specified queues.

Get-MsmqQueueManager

Gets a QueueManager state info object that represents the local queue manager.

Get-MsmqQueueManagerACL

Gets an array of MsmqQueueManagerAcl objects for the local queue manager.

Move-MsmqMessage

Moves messages between subqueues of the same queue or between the main queue and one of its subqueues.

New-MsmqMessage

Creates and returns a System.Messaging.Message object with properties as specified by the parameters.

New-MsmqQueue

Creates a new queue.

Receive-MsmqQueue

Does a destructive read from a queue.

Remove-MsmqCertificate

Removes the specified personal certificate.

Remove-MsmqQueue

Deletes the specified queues.

Resume-MsmqOutgoingQueue

Resumes specified outgoing queues.

Send-MsmqQueue

Sends a test message to the specified queues.

Set-MsmqQueue

Sets queue properties.

Set-MsmqQueueACL

Modifies access rights to queues.

Set-MsmqQueueManager

Configures the properties of the specified queue manager.

Set-MsmqQueueManagerACL

Modifies access rights of the local queue manager.

Suspend-MsmqOutgoingQueue

Pauses the specified outgoing queues.