1
votes

I am trying to get queue depth for remote IBM MQ using PowerShell script/commands. Seems it is not working correctly, please help.

Powershell script:

{
$myremoteconns = New-WMQQmgrConnDef -Name T.test.TEST.QM1 -Hostname abcd_testhost01 -Port 1111 -Channel T.test.MQMQ.TESTCHN

$qm = Get-WMQQueueManager -Connections $myremoteconns | where {$_.Name -like 'T.test.TEST.QM1'} 

Error message received:

Error CategoryInfo : InvalidData: (:) [Get-WMQQueueManager], arameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,WebSphereMQ.GetWMQQueueManager

Already installed WebSphere MQ - Windows PowerShell Library from below.

http://www-01.ibm.com/support/docview.wss?uid=swg24017698

Thanks

2
Can you set the following environment variable and run the command again. $DebugPreference = "Continue" Setting the above env variable will provide more debug statements and it might helpsubbaraoc
Your command has to be $myremoteconns += New-WMQQmgrConnDef -Name T.test.TEST.QM1 -Hostname abcd_testhost01 -Port 1111 -Channel T.test.MQMQ.TESTCHNsubbaraoc

2 Answers

1
votes

To get remote queue manager information,you have to follow the following steps as stated in the powershellcookbook.pdf which comes along with MO74.

PS C:\> $qmconns = @()
PS C:\> $qmconns += New-WMQQmgrConnDef -Name DALEQM -Hostname dlane.hursley.ini.com -Channel SVRCN -Port 1414
PS C:\> $qmconns += New-WMQQmgrConnDef -Name CENTQM -Hostname sysserv.boulder.ini.com -Channel SVRCN -Port 1418
PS C:\>
PS C:\> $qmgrs = Get-WMQQueueManager –Connections $qmconns
PS C:\> $remoteqmgrs = Get-WMQQueueManager –Connections $qmconns | Where { $_.Hostname –like “*.hursley.ini.com” }

In your first command "+" is missing.

0
votes

Sorry but you will never get the current queuedepth out of a remote queue - it does not have one since it is a pointer to another qmgr. To be sure it would be necessary to see the MQ Completion and Reason Code.