1

I need to get service broker queue status (Enabled/Disabled) somehow programmatically. Either, T-SQL, PowerShell, etc. I tried $MyQueue = Get-ChildItem SQLSERVER:\SQL\mydbserver\default\databases\MyQueue\ServiceBroker\Queues | where {$_.Name -like "MyQueue"} but couldn’t find how to get the status. Thanks in advance.

1 Answer 1

2

PoSh just wraps SMO. ServiceQueue exposes IsEnqueueEnabled for queue status, IsActivationEnabled for activation status, IsRetentionEnabled for retention status and finally IsPoisonMessageHandlingEnabled for, well, poison message handling status.

Also PoSh has the habit of hiding properties. See how to see all properties.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.