I wanted to announce the release of the most requested feature for the PowerShell library for WebSphere MQ SupportPac : support for administering remote queue managers.

I’ve already covered my work on PowerShell for WebSphere MQ at some length on this blog, so I won’t duplicate that here. (If you are interested in a recap, this is a good place to start).

Using PowerShell with remote queue managersWith this latest release, you can now manage queue managers across multiple servers from a single PowerShell window on your local workstation.

You can now write commands which query and/or modify your queues, channels, etc. across multiple queue managers spanning multiple servers on multiple operating systems. All in a single command or line of script.

It currently works with queue managers running on supported Windows and UNIX-based operating systems. (It is not currently possible to administer z/OS queue managers with this, however work on this has begun and should be added in a future release).

Ideas for what can be done with this are welcomed – I’ve put a couple of examples after the break.

Example 1: Check all of your queues on all queue managers across multiple servers for any that are full

PS C:\> $allqmgrs = Get-WMQQueueManager -Connections $myremoteconns
PS C:\> Get-WMQQueue -Qmgr $allqmgrs | Where { $_.CurrentDepth -eq $_.MaximumDepth } | Select Name, @{e={$_.QueueManager.Name};n='Queue Manager'}, @{e={$_.QueueManager.Hostname};n='Server'}

which will draw a table containing a list of any queues which are full, showing their name, and the name of their queue manager and the hostname of the server it is on.

Example 2: Change the SSL Cipher Specification setting for all channels currently using NULL_MD5 to TRIPLE_DES_SHA_US on all remote queue managers

PS C:\> $allqmgrs = Get-WMQQueueManager -Connections $myremoteconns
PS C:\> Get-WMQChannel -Qmgr $allqmgrs | Where { $_.SSLCipherSpec -eq "NULL_MD5" } | Set-WMQChannel -SSLCipherSpec "TRIPLE_DES_SHA_US"

More examples can be found in the PowerShell ‘Cookbook’ document that is contained in the SupportPac download zip.

Finally, note that there is no need for PowerShell or any other custom code to be installed on the remote servers. The WebSphere MQ PowerShell library uses a client connection to communicate to remote queue manager using PCF. As a result, the setup required on the queue managers is the same as for other administration tools such as WebSphere MQ Explorer (requiring a valid server connection channel and active channel listener).

As always, feedback on this is very welcome – either here or in the SupportPac forum.