Returns information about queued messages on a computer running Microsoft Exchange Server 2003
On Error Resume NextstrComputer = "."Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" & strComputer & _"\ROOT\MicrosoftExchangeV2")Set colItems = objWMIService.ExecQuery _("Select * from Exchange_QueuedMessage")For Each objItem in colItemsWscript.Echo "Action deleted NDR: " & objItem.ActionDeletedNDRWscript.Echo "Action deleted no NDR: " & _objItem.ActionDeletedNoNDRWscript.Echo "Action freeze: " & objItem.ActionFreezeWscript.Echo "Action thaw: " & objItem.ActionThawWscript.Echo "Expiry: " & objItem.ExpiryWscript.Echo "High priority: " & objItem.HighPriorityWscript.Echo "Link ID: " & objItem.LinkIDWscript.Echo "Link name: " & objItem.LinkNameWscript.Echo "Low priority: " & objItem.LowPriorityWscript.Echo "Message ID: " & objItem.MessageIDWscript.Echo "Normal priority: " & objItem.NormalPriorityWscript.Echo "Protocol ID: " & objItem.ProtocolNameWscript.Echo "Queue ID: " & objItem.QueueIDWscript.Echo "Queue name: " & objItem.QueueNameWscript.Echo "Received: " & objItem.ReceivedWscript.Echo "Recipient count: " & objItem.RecipientCountWscript.Echo "Recipients: " & objItem.RecipientsWscript.Echo "Sender: " & objItem.SenderWscript.Echo "Size: " & objItem.SizeWscript.Echo "State flags: " & objItem.StateFlagsWscript.Echo "State frozen: " & objItem.StateFrozenWscript.Echo "State retry: " & objItem.StateRetryWscript.Echo "Subject: " & objItem.SubjectWscript.Echo "Submission: " & objItem.SubmissionWscript.Echo "Version: " & objItem.VersionWscript.Echo "Virtual machine: " & objItem.VirtualMachineWscript.Echo "Virtual server name: " & _objItem.VirtualServerNameWscript.EchoNext
This is a VB Script, this can be used by saving the file in .vbs file