I'm trying to get a count of the number of messages in the dead-letter queue using VBScript. Here's my code:
Option Explicit
Dim mqQ, QueueName
set mqQ = CreateObject("MSMQ.MSMQManagement")
mqQ.Init "localhost", , "DIRECT=OS:localhost\system$;deadletter"
wscript.echo mqQ.MessageCount & " messsages"
Here's the error I'm getting:
D:\msmq_queue.vbs(4, 1) MSMQManagement: Operations of the type requested (for example, deleting a queue using a direct format name) are not supported for the format name specified.
I use this format to grab private message count, but I'm getting this error in dead-letter.