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.
Add a comment
|
1 Answer
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.
-
1Id addition to Remus's answer, the t-sql equivalent is in sys.service_queues msdn.microsoft.com/en-us/library/ms187795.aspx Aug 12, 2014 at 14:44