How to know programmatically whether Message Queueing is enabled on the machine or not?

前端 未结 4 1395
情深已故
情深已故 2021-02-20 15:18

I know that when I try to create new MessageQueue, system throws InvalidOperationException if the Message Queuing is not enabled.

But how to k

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-20 15:59

    Answering little late, but if you are scripting fan Powershell is at your help. To get status update on numbers, use following script:

    $queues = Get-WmiObject Win32_PerfFormattedData_msmq_MSMQQueue
    $queues | ft -property Name,MessagesInQueue
    

    This will show you name of queue and number of items in each queue. Hope this will help someone someday. :D

提交回复
热议问题