MQ

MQ

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  IBM MQ Channel Status Query Issue with Service Account in Powershell

    Posted Sun March 30, 2025 08:59 PM

    Hi,

    I have an IBM MQ environment with a single Queue Manager, queues, and channels. I've developed a PowerShell script to monitor:

    • Queue Manager status
    • Queue depths
    • Channel status

    To retrieve the channel status, I'm using the following PowerShell commands:

    <response-element class="" ng-version="0.0.0-PLACEHOLDER"></response-element>

    PowerShell
    $command = "DISPLAY CHSTATUS(*) STATUS"
    $channelstatus = $command | runmqsc $queueManagerName
    

    <response-element class="" ng-version="0.0.0-PLACEHOLDER"></response-element>

    Issue:

    • When I execute the script using my personal user account, it functions correctly, and I receive the expected channel status output.
    • However, when I run the same script with a designated service account, the $channelstatus variable returns no output.
    • The service account successfully retrieves the Queue Manager status using:

    <response-element class="" ng-version="0.0.0-PLACEHOLDER"></response-element>

    PowerShell
    $command = "dspmq -m $queueManagerName"
    

    <response-element class="" ng-version="0.0.0-PLACEHOLDER"></response-element>

    Question:

    How can I grant the service account the necessary permissions to:

    • Execute the DISPLAY CHSTATUS command within runmqsc.
    • Successfully retrieve channel status information?

    In essence, I need to know how to grant the service account the authorization to run runmqsc $queueManagerName and recieve the channel status information.



    ------------------------------
    Naveen P
    ------------------------------


  • 2.  RE: IBM MQ Channel Status Query Issue with Service Account in Powershell

    Posted Mon March 31, 2025 01:26 AM

    this may well have something to do with the environment in which the command is run.
    Have you tried sourcing the setmqenv command before executing your commands?

    Hope it helps



    ------------------------------
    Francois Brandelik
    ------------------------------



  • 3.  RE: IBM MQ Channel Status Query Issue with Service Account in Powershell

    Posted Fri April 04, 2025 06:14 AM

    I'm guessing that your service account is not a privileged user? Whereas presumably your personal user account is? i.e. is in the mqm group?

    So, either you grant the service account the missing authorities, which will be shown in your queue manager AMQERR01.LOG, or put it in the mqm group.

    If you need assistance with the error log contents, do reply with what you see there and we can help you to build the command you need to grant the appropriate authorities.

    It would be interesting to see what response you actually got back from the runmqsc command you issued. Could you show us that too please?

    Cheers,
    Morag



    ------------------------------
    Morag Hughson
    MQ Technical Education Specialist
    MQGem Software Limited
    Website: https://www.mqgem.com
    ------------------------------