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.

Namespace

\\COMPUTERNAME\ROOT\MicrosoftExchangeV2:Exchange_Queue

Provider

The CIM_LogicalElement provider supplies instances of the Exchange_Queue class.

Origin

The Exchange_Queue class extends the CIM_LogicalElement class.

Qualifiers

Abstract

Properties

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
[key,
 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
[key,
 read] String VirtualMachine;

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

VirtualServerName Property
[key,
 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
[read,
 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.

Methods

This class has no methods.

Associations

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}!//"& _
cComputerName&"/"&cWMINameSpace
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."
Else
  '
  ' 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
   Wscript.Echo""
   Wscript.Echo""
       '
       ' Display the value of the CanEnumAll property.
       WScript.echo "CanEnumAll               = "& _
        " ["&TypeName(objExchange_Queue.CanEnumAll)&"] "& _
       objExchange_Queue.CanEnumAll
       '
       '
       ' Display the value of the GlobalStop property.
       WScript.echo "GlobalStop               = "& _
        " ["&TypeName(objExchange_Queue.GlobalStop)&"] "& _
       objExchange_Queue.GlobalStop
       '
       '
       ' Display the value of the LinkId property.
       WScript.echo "LinkId                   = "& _
        " ["&TypeName(objExchange_Queue.LinkId)&"] "& _
       objExchange_Queue.LinkId
       '
       '
       ' Display the value of the LinkName property.
       WScript.echo "LinkName                 = "& _
        " ["&TypeName(objExchange_Queue.LinkName)&"] "& _
       objExchange_Queue.LinkName
       '
       '
       ' Display the value of the MessageCount property.
       WScript.echo "MessageCount             = "& _
        " ["&TypeName(objExchange_Queue.MessageCount)&"] "& _
       objExchange_Queue.MessageCount
       '
       '
       ' Display the value of the MsgEnumFlagsSupported property.
       WScript.echo "MsgEnumFlagsSupported    = "& _
        " ["&TypeName(objExchange_Queue.MsgEnumFlagsSupported)&"] "& _
       objExchange_Queue.MsgEnumFlagsSupported
       '
       '
       ' Display the value of the ProtocolName property.
       WScript.echo "ProtocolName             = "& _
        " ["&TypeName(objExchange_Queue.ProtocolName)&"] "& _
       objExchange_Queue.ProtocolName
       '
       '
       ' Display the value of the QueueId property.
       WScript.echo "QueueId                  = "& _
        " ["&TypeName(objExchange_Queue.QueueId)&"] "& _
       objExchange_Queue.QueueId
       '
       '
       ' Display the value of the QueueName property.
       WScript.echo "QueueName                = "& _
        " ["&TypeName(objExchange_Queue.QueueName)&"] "& _
       objExchange_Queue.QueueName
       '
       '
       ' Display the value of the Size property.
       WScript.echo "Size                     = "& _
        " ["&TypeName(objExchange_Queue.Size)&"] "& _
       objExchange_Queue.Size
       '
       '
       ' Display the value of the Version property.
       WScript.echo "Version                  = "& _
        " ["&TypeName(objExchange_Queue.Version)&"] "& _
       objExchange_Queue.Version
       '
       '
       ' Display the value of the VirtualMachine property.
       WScript.echo "VirtualMachine           = "& _
        " ["&TypeName(objExchange_Queue.VirtualMachine)&"] "& _
       objExchange_Queue.VirtualMachine
       '
       '
       ' Display the value of the VirtualServerName property.
       WScript.echo "VirtualServerName        = "& _
        " ["&TypeName(objExchange_Queue.VirtualServerName)&"] "& _
       objExchange_Queue.VirtualServerName
       '
    Next
  Else
    ' If no Exchange_Queue instances were returned,
    ' display that.
    WScript.Echo "WARNING: No Exchange_Queue instances were returned."
  End If
End If

Show: