This documentation is archived and is not being maintained.

Exchange_Queue Class

Exchange Server 2003

Exchange_Queue Class

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The Exchange_Queue WMI class provides properties and methods for working with Microsoft® Exchange queues.




The CIM_LogicalElement provider supplies instances of the Exchange_Queue class.


The Exchange_Queue class extends the CIM_LogicalElement class.




Property Description
LinkId Property
[key, read] String LinkId;

The LinkId property indicates the identifier for the link that contains the queue.

LinkName Property
[key, read] String LinkName;

The LinkName property indicates the name of the link that contains the queue.

ProtocolName Property
 read] String ProtocolName;

The ProtocolName property indicates the transmission protocol for the queue.

QueueId Property
[key, read] String QueueId;

The QueueId property indicates the identifier of the queue.

QueueName Property
[key, read] String QueueName;

The QueueName property indicates the name of the queue.

VirtualMachine Property
 read] String VirtualMachine;

The VirtualMachine property indicates the name of the virtual machine that contains the queue.

VirtualServerName Property
 read] String VirtualServerName;

The VirtualServerName property indicates the name of the virtual server the queue is on.

CanEnumAll Property
[read] Boolean CanEnumAll;

The CanEnumAll property indicates whether the queue can enumerate all of the messages that it has waiting for transmission.

GlobalStop Property
[read] Boolean GlobalStop;

The GlobalStop property indicates whether the virtual server for the queue is in disabled mode. If True, the virtual server is disabled.

MessageCount Property
[read] Uint32 MessageCount;

The MessageCount property indicates the number of messages in the queue.

MsgEnumFlagsSupported Property
[read] Uint32 MsgEnumFlagsSupported;

The MsgEnumFlagsSupported property contains a mask of all enumeration flags for the queue.

Size Property
 Units("KB")] Uint64 Size;

The Size property indicates the size of the queue.

Version Property
[read] Uint32 Version;

The Version property indicates the version of the Queue Application Programming Interface (QAPI) used to generate the WMI object.


This class has no methods.


This class has no associations.

VBScript Example

The following example shows how to retrieve a list of Exchange_Queue instances, and how to retrieve all the associated properties.

' Purpose:   Display each Exchange_Queue found for Exchange server,
'            and show all properties on the Exchange_Queue
'            objects
' Change:    cComputerName [string] the computer to access
' Output:    Displays the name of each Exchange_Queue and properties

On Error Resume Next
Dim cComputerName
Const cWMINameSpace = "root/MicrosoftExchangeV2"
Const cWMIInstance = "Exchange_Queue"
cComputerName = "MyComputerNETBIOSName"

Dim strWinMgmts		' Connection string for WMI
Dim objWMIExchange	' Exchange Namespace WMI object
Dim listExchange_Queues	' ExchangeLogons collection
Dim objExchange_Queue		' A single ExchangeLogon WMI object

' Create the object string, indicating WMI (winmgmts), using the
' current user credentials (impersonationLevel=impersonate),
' on the computer specified in the constant cComputerName, and
' using the CIM namespace for the Exchange provider.
strWinMgmts = "winmgmts:{impersonationLevel=impersonate}!//"& _
Set objWMIExchange =  GetObject(strWinMgmts)
' Verify we were able to correctly set the object.
If Err.Number <> 0 Then
  WScript.Echo "ERROR: Unable to connect to the WMI namespace."
  ' The Resources that currently exist appear as a list of
  ' Exchange_Queue instances in the Exchange namespace.
  Set listExchange_Queues = objWMIExchange.InstancesOf(cWMIInstance)
  ' Were any Exchange_Queue Instances returned?
  If (listExchange_Queues.count > 0) Then
    ' If yes, do the following:
    ' Iterate through the list of Exchange_Queue objects.
    For Each objExchange_Queue in listExchange_Queues
       ' Display the value of the CanEnumAll property.
       WScript.echo "CanEnumAll               = "& _
        " ["&TypeName(objExchange_Queue.CanEnumAll)&"] "& _
       ' Display the value of the GlobalStop property.
       WScript.echo "GlobalStop               = "& _
        " ["&TypeName(objExchange_Queue.GlobalStop)&"] "& _
       ' Display the value of the LinkId property.
       WScript.echo "LinkId                   = "& _
        " ["&TypeName(objExchange_Queue.LinkId)&"] "& _
       ' Display the value of the LinkName property.
       WScript.echo "LinkName                 = "& _
        " ["&TypeName(objExchange_Queue.LinkName)&"] "& _
       ' Display the value of the MessageCount property.
       WScript.echo "MessageCount             = "& _
        " ["&TypeName(objExchange_Queue.MessageCount)&"] "& _
       ' Display the value of the MsgEnumFlagsSupported property.
       WScript.echo "MsgEnumFlagsSupported    = "& _
        " ["&TypeName(objExchange_Queue.MsgEnumFlagsSupported)&"] "& _
       ' Display the value of the ProtocolName property.
       WScript.echo "ProtocolName             = "& _
        " ["&TypeName(objExchange_Queue.ProtocolName)&"] "& _
       ' Display the value of the QueueId property.
       WScript.echo "QueueId                  = "& _
        " ["&TypeName(objExchange_Queue.QueueId)&"] "& _
       ' Display the value of the QueueName property.
       WScript.echo "QueueName                = "& _
        " ["&TypeName(objExchange_Queue.QueueName)&"] "& _
       ' Display the value of the Size property.
       WScript.echo "Size                     = "& _
        " ["&TypeName(objExchange_Queue.Size)&"] "& _
       ' Display the value of the Version property.
       WScript.echo "Version                  = "& _
        " ["&TypeName(objExchange_Queue.Version)&"] "& _
       ' Display the value of the VirtualMachine property.
       WScript.echo "VirtualMachine           = "& _
        " ["&TypeName(objExchange_Queue.VirtualMachine)&"] "& _
       ' Display the value of the VirtualServerName property.
       WScript.echo "VirtualServerName        = "& _
        " ["&TypeName(objExchange_Queue.VirtualServerName)&"] "& _
    ' If no Exchange_Queue instances were returned,
    ' display that.
    WScript.Echo "WARNING: No Exchange_Queue instances were returned."
  End If
End If