MSMQ Cmdlets in Windows PowerShell
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.