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).
With 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.
12 comments
Comments feed for this article
January 17, 2008 at 5:39 pm
Windows PowerShell : Managing Remote WebSphere MQ via PowerShell/Should CMDLETS do their own Remoting?
[…] administering remote queue managers. You can read the details and see a couple of examples HERE. Kudos to Dale and that team! What this allows you to perform operations on multiple […]
January 17, 2008 at 6:07 pm
Managing Remote WebSphere MQ via PowerShell/Should CMDLETS do their own Remoting? - Noticias externas
[…] administering remote queue managers. You can read the details and see a couple of examples HERE. Kudos to Dale and that team! What this allows you to perform operations on multiple […]
January 17, 2008 at 9:22 pm
learning something new » Blog Archive » Adding remote system admin support to PowerShell (before PowerShell V2)
[…] of Microsoft has written a very interesting post on PowerShell cmdlet development, prompted by the release of my latest updates to the WebSphere MQ PowerShell […]
January 18, 2008 at 4:54 am
links for 2008-01-18 « betaalfa.com
[…] Using PowerShell with remote queue managers « a Hursley view on WebSphere MQ (tags: wmq powershell) […]
January 29, 2008 at 7:06 am
chillin_in_MN
Intrigued by the idea of a centralized, client script to enumerate some Local & Remote Definitions on multiple, remote Queue Managers (AIX, Win, Sun & eventually zOS(?)).
have tried this: (Sanitized just a bit …please forgive the formatting)
Running from a vanilla XP SP2 PC – w WMQ v6.0.2.2 Client
Other Client Connectivity seems OK…
GAC Version Location
— ——- ——–
True v1.1.4322 C:\WINDOWS\assembly\GAC\amqmdnet\1.0.0.3__dd3cb1c9aae9ec97\amqmdnet.dll
PS C:\apps\PSH_WMQ> $qmconns = @()
PS C:\apps\PSH_WMQ> $qmconns += New-WMQQmgrConnDef -Name BQMDEV01 -Hostname mwidev01.my.edu -Channel SVRCONN.BQMDEV01
-Port 1414
PS C:\apps\PSH_WMQ> $qmconns += New-WMQQmgrConnDef -Name BQMDEV02 -Hostname mwidev02.my.edu -Channel SVRCONN.BQMDEV02
-Port 1414
Keep Getting this sort of error, using GET-WMQQueueManager Objects, always seems to boil down to “… not set to an instance of an object…”
PS C:\apps\PSH_WMQ> $remoteqmgrs = Get-WMQQueueManager -Connections $qmconns | Where { $_.Hostname -like “mwi*.my.edu
” }
Get-WMQQueueManager : Object reference not set to an instance of an object.
At line:1 char:35
+ $remoteqmgrs = Get-WMQQueueManager <<< Connect-WMQQmgr -name “BQMDEV01” -h “mwidev01” -p 1414 -s “SVRCONN.BQMDEV01”
PS-WMQ BQMDEV01 > Display-WMQQmgrAttrs
…
IsConnected : True
IsClient : True
CodedCharSetId : 437
AlterationDateTime : 1/3/2008 11:14:08 AM
…
CommandInputQueueName : SYSTEM.ADMIN.COMMAND.QUEUE
CommandLevel : 600
CreationDateTime : 2/16/2006 4:06:34 PM
DeadLetterQueueName : DLQ
…
Platform : 3
QueueManagerDescription : Broker BRKDEV01 Queue Manager
QueueManagerIdentifier : BQMDEV01_2006-02-16_16.06.34
…
Name : BQMDEV01
…
IsOpen : False
OpenStatus : True
AlternateUserId :
ConnectionReference : IBM.WMQ.MQQueueManager
CompletionCode : 2
ReasonCode : 2067
ReasonName : MQRC_SELECTOR_ERROR
Seem to have hit a snag… Anyone got some examples or ideas to try??
Cutting and Pasting from the blog entries and the Cookbook.pdf has helped but now I seem to be stuck…
January 29, 2008 at 9:52 am
Dale Lane
@chillin_in_MN
The presence of command names Connect-WMQQmgr and Display-WMQQmgrAttrs suggest that you’re not actually using the SupportPac-provided cmdlets that this post (and the cookbook pdf) is about. (Neither of those are names of commands in the SupportPac library)
Are you using the scripts I was playing with in an earlier post last April? If so, I would recommend removing these before you start to use the new cmdlets.
March 4, 2008 at 12:38 pm
Reg Danford-Cordingley
Hi Dale,
Many congratulations on the recent addition to your family which I saw on your other blog.
I saw your last post on the Powershell for MQ forum so if you could send me the new version of the Powershell Pac when you have a chance that would be great. Once I have it installed, I will let you know how I get on.
I have also taken the liberty of adding a link here to my tech blog site (www.tech-crm.com).
Regards,
Regdc
March 4, 2008 at 11:26 pm
Dale Lane
@Reg – I’ve sent you a copy of the modified SupportPac by email. Thanks again for highlighting the issue.
And many thanks for the congratulations 🙂
July 1, 2008 at 12:08 am
Development in a Blink » Blog Archive » IBM WebSphere MQ – PowerShell Library
[…] Using PowerShell with remote queue managers […]
July 1, 2008 at 11:06 am
Stefan Stranger's Weblog : PowerShell CMDLets for WebSphere MQ - administer queues on Windows or Linux
[…] source for using PowerShell with remote queue managers can be found here. Published Tuesday, July 01, 2008 12:06 PM by stefstr Filed under: Third-Party, OpsMgr 2007, […]
December 11, 2009 at 10:17 pm
Scott Saad
Hi there. I’m a software engineer and a huge fan of PowerShell. There are a few applications that I’ve written that integrate with WebSphere MQ. I remember hearing about the PowerShell integration a while back but didn’t have a need to use it at the time because I was on other projects. Well, I’m back on a project that requires MQ so I decided to dig into the Snapin that was written.
All of the queues that I access are remote and I have a signer certificate that ensures all communication is behind SSL Triple Des. The first thing I attempted to do was get a list of the Queue Managers (Get-WMQQueueManager), passing in a MQQmgrConnDef that describes the connection. Nothing was getting returned and I figured it was because there was no (obvious) way to specify the SSL key repository path. Therefore, I end up getting WMQ ERR: 2393.
Are there any plans to make this possible or is there something I’m missing that I can do now?
Thank for your time!
Scott
December 11, 2009 at 10:35 pm
Scott Saad
OK. I think I found a workaround for the time being. I can setup the MQEnvironment class within PowerShell, prior to executing any cmdlet’s and all works fine. The properties I had to set for my use were:
[IBM.WMQ.MQEnvironment]::SSLCipherSpec
[IBM.WMQ.MQEnvironment]::SSLKeyRepository
It would be great if somehow I could set this through the cmdlet’s but this will do for now. 🙂
Thanks again for the PowerShell goodness!
Scott