The Exchange_Mailbox WMI class has properties that return information about Microsoft® Exchange mailboxes.
Namespace
\\COMPUTERNAME\ROOT\MicrosoftExchangeV2:Exchange_Mailbox
Provider
The ExchangeMapiTableProvider supplies instances of the Exchange_Mailbox class.
Origin
The Exchange_Mailbox class extends the CIM_LogicalElement class.
Qualifiers
dynamic
Properties
| Property | Description |
|---|
| LegacyDN Property |
[key, read] string LegacyDN;
The LegacyDN property indicates the legacyDN of the mailbox and matches the legacyExchangeDN attribute of the user object in
Microsoft Active Directory®. |
| MailboxGUID Property |
[key, read] string MailboxGUID;
The MailboxGUID property indicates the globally unique identifier (GUID) that links the mailbox to a user in
Active Directory. |
| ServerName Property |
[key, read] string ServerName;
The ServerName property indicates the name of the server where the mailbox resides. |
| StorageGroupName Property |
[key,
read] string StorageGroupName;
The StorageGroupName property indicates the name of the storage group that contains the mailbox. |
| StoreName Property |
[key, read] string StoreName;
The StoreName property indicates the name of the message database (MDB) that contains the mailbox. |
| AssocContentCount Property |
[read] uint32 AssocContentCount;
The AssocContentCount property indicates the total number of messages associated with the mailbox folders. |
| DateDiscoveredAbsentInDS Property |
[read] datetime DateDiscoveredAbsentInDS;
The DateDiscoveredAbsentInDS property indicates when the store detected that the mailbox no longer had a corresponding user entry in
Active Directory. Mailboxes without Active Directory user entries are known as disconnected mailboxes. |
| DeletedMessageSizeExtended Property |
[read,
Units("Bytes")] uint64 DeletedMessageSizeExtended;
The DeletedMessageSizeExtended property indicates the cumulative size of all deleted messages that are still being retained according to retention policy settings. |
| LastLoggedOnUserAccount Property |
[read] string LastLoggedOnUserAccount;
The LastLoggedOnUserAccount property indicates the account name last used to log on to the mailbox. |
| LastLogoffTime Property |
[read] datetime LastLogoffTime;
The LastLogoffTime property indicates the time that the last user logged off. |
| LastLogonTime Property |
[read] datetime LastLogonTime;
The LastLogonTime property indicates the time that the last user logged on. |
| MailboxDisplayName Property |
[read] string MailboxDisplayName;
The MailboxDisplayName property indicates the display name of the mailbox and matches the displayName attribute in
Active Directory. |
| Size Property |
[read,
Units("Bytes")] uint64 Size;
The Size property indicates the cumulative size of all of the messages in the mailbox, in bytes. |
| StorageLimitInfo Property |
[read,
Values{"Below Limit", "Issue Warning",
"Prohibit Send", "No Checking",
"Mailbox Disabled"},
ValueMap{"1", "2", "4", "8",
"16"}] uint32 StorageLimitInfo;
The StorageLimitInfo property contains the storage limit settings on the mailbox. |
| TotalItems Property |
[read] uint32 TotalItems;
The TotalItems property indicates the total number of messages in the mailbox. |
Methods
| Method | Description |
|---|
| Purge Method |
[implemented] void Purge();
The Purge method removes the mailbox from the store permanently. The Purge method is available only if the mailbox is disconnected. |
| Reconnect Method |
[implemented] void Reconnect(
[in] string UserLogonName);
The Reconnect method allows a disconnected mailbox to be reconnected to an existing user object in
Active Directory. The user must not already be mail-enabled. |
Associations
This class has no associations.
VBScript Example
The following example shows how to retrieve a list of Exchange_Mailbox instances, and how to retrieve all the associated properties.
'===============================================================
' Purpose: Display each Exchange_Mailbox found for Exchange server,
' and show all properties on the Exchange_Mailbox
' objects
' Change: cComputerName [string] the computer to access
' Output: Displays the name of each Exchange_Mailbox and properties
'===============================================================
On Error Resume Next
Dim cComputerName
Const cWMINameSpace = "root/MicrosoftExchangeV2"
Const cWMIInstance = "Exchange_Mailbox"
cComputerName = "MyComputerNETBIOSName"
Dim strWinMgmts ' Connection string for WMI
Dim objWMIExchange ' Exchange Namespace WMI object
Dim listExchange_Mailboxs ' ExchangeLogons collection
Dim objExchange_Mailbox ' 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_Mailbox instances in the Exchange namespace.
Set listExchange_Mailboxs = objWMIExchange.InstancesOf(cWMIInstance)
'
' Were any Exchange_Mailbox Instances returned?
If (listExchange_Mailboxs.count > 0) Then
' If yes, do the following:
' Iterate through the list of Exchange_Mailbox objects.
For Each objExchange_Mailbox in listExchange_Mailboxs
Wscript.Echo""
Wscript.Echo""
'
' Display the value of the AssocContentCount property.
WScript.echo "AssocContentCount = "& _
" ["&TypeName(objExchange_Mailbox.AssocContentCount)&"] "& _
objExchange_Mailbox.AssocContentCount
'
'
' Display the value of the DateDiscoveredAbsentInDS property.
WScript.echo "DateDiscoveredAbsentInDS = "& _
" ["&TypeName(objExchange_Mailbox.DateDiscoveredAbsentInDS)&"] "& _
objExchange_Mailbox.DateDiscoveredAbsentInDS
'
'
' Display the value of the DeletedMessageSizeExtended property.
WScript.echo "DeletedMessageSizeExtended= "& _
" ["&TypeName(objExchange_Mailbox.DeletedMessageSizeExtended)&"] "& _
objExchange_Mailbox.DeletedMessageSizeExtended
'
'
' Display the value of the LastLoggedOnUserAccount property.
WScript.echo "LastLoggedOnUserAccount = "& _
" ["&TypeName(objExchange_Mailbox.LastLoggedOnUserAccount)&"] "& _
objExchange_Mailbox.LastLoggedOnUserAccount
'
'
' Display the value of the LastLogoffTime property.
WScript.echo "LastLogoffTime = "& _
" ["&TypeName(objExchange_Mailbox.LastLogoffTime)&"] "& _
objExchange_Mailbox.LastLogoffTime
'
'
' Display the value of the LastLogonTime property.
WScript.echo "LastLogonTime = "& _
" ["&TypeName(objExchange_Mailbox.LastLogonTime)&"] "& _
objExchange_Mailbox.LastLogonTime
'
'
' Display the value of the LegacyDN property.
WScript.echo "LegacyDN = "& _
" ["&TypeName(objExchange_Mailbox.LegacyDN)&"] "& _
objExchange_Mailbox.LegacyDN
'
'
' Display the value of the MailboxDisplayName property.
WScript.echo "MailboxDisplayName = "& _
" ["&TypeName(objExchange_Mailbox.MailboxDisplayName)&"] "& _
objExchange_Mailbox.MailboxDisplayName
'
'
' Display the value of the MailboxGUID property.
WScript.echo "MailboxGUID = "& _
" ["&TypeName(objExchange_Mailbox.MailboxGUID)&"] "& _
objExchange_Mailbox.MailboxGUID
'
'
' Display the value of the ServerName property.
WScript.echo "ServerName = "& _
" ["&TypeName(objExchange_Mailbox.ServerName)&"] "& _
objExchange_Mailbox.ServerName
'
'
' Display the value of the Size property.
WScript.echo "Size = "& _
" ["&TypeName(objExchange_Mailbox.Size)&"] "& _
objExchange_Mailbox.Size
'
'
' Display the value of the StorageGroupName property.
WScript.echo "StorageGroupName = "& _
" ["&TypeName(objExchange_Mailbox.StorageGroupName)&"] "& _
objExchange_Mailbox.StorageGroupName
'
'
' Display the value of the StorageLimitInfo property.
WScript.echo "StorageLimitInfo = "& _
" ["&TypeName(objExchange_Mailbox.StorageLimitInfo)&"] "& _
objExchange_Mailbox.StorageLimitInfo
'
'
' Display the value of the StoreName property.
WScript.echo "StoreName = "& _
" ["&TypeName(objExchange_Mailbox.StoreName)&"] "& _
objExchange_Mailbox.StoreName
'
'
' Display the value of the TotalItems property.
WScript.echo "TotalItems = "& _
" ["&TypeName(objExchange_Mailbox.TotalItems)&"] "& _
objExchange_Mailbox.TotalItems
'
Next
Else
' If no Exchange_Mailbox instances were returned,
' display that.
WScript.Echo "WARNING: No Exchange_Mailbox instances were returned."
End If
End If