IExchangeManageStore::GetMailboxTable
The GetMailboxTable method obtains information about all of the mailboxes on a server.
HRESULT GetMailboxTable(
LPTSTR lpszServerName,
LPMAPITABLE FAR * lppTable,
ULONG ulFlags
);
Parameters
-
lpszServerName
-
Input parameter. Points to a string that contains the distinguished name (DN) of the server.
-
lppTable
-
Output parameter. Points to a MAPI IMAPITable interface containing the information about all of the mailboxes on the server specified in lpszServerName.
-
ulFlags
-
Input parameter. A defined value that specifies whether the server name is Unicode:
-
MAPI_UNICODE
-
The server name is in Unicode format.
-
0
-
(Zero) The server name is in ASCII format.
Return Values
See Return Values.
In addition, GetMailboxTable can return one of the following values:
-
SUCCESS_SUCCESS
-
The method completed successfully.
-
MAPI_E_CALL_FAILED
-
An unknown error occurred.
-
MAPI_E_INVALID_PARAMETER
-
One of the parameters was not valid.
-
MAPI_E_LOGON_FAILED
-
The Microsoft Exchange Server information store is not running on the server.
-
MAPI_E_NETWORK_ERROR
-
Cannot connect to the server.
-
MAPI_E_NO_ACCESS
-
The user has no permissions on the folder.
-
MAPI_E_NOT_ENOUGH_MEMORY
-
There wasn't enough memory to complete the operation.
Remarks
The GetMailboxTable method returns a pointer to a MAPI table whose rows represent each of the mailboxes on the server you specify in lpszServerName. The columns of this table give you information such as the mailbox name (in PR_DISPLAY_NAME), the sizes of each of the messages in the mailbox (in PR_MESSAGE_SIZE), and the total number of messages in the mailbox (in PR_ASSOC_CONTENT_COUNT).
The following properties are returned for each mailbox:
-
PR_DISPLAY_NAME
-
A MAPI property containing the name of the mailbox as displayed.
-
PR_EMAIL_ADDRESS
-
A MAPI property containing the e-mail address of the mailbox.
-
PR_LOCALE_ID
-
The locale identifier (LCID) of the mailbox.
-
PR_MESSAGE_SIZE
-
A MAPI property contains the sum (in bytes) of the sizes of all properties on a message object.
-
PR_MESSAGE_SIZE_EXTENDED
-
The sum (in bytes) of the sizes of all properties on a message object. This is an 8-byte version of the MAPI PR_MESSAGE_SIZE property.
-
PR_CONTENT_COUNT
-
A MAPI property containing the total number of normal messages in the mailbox.
-
PR_ASSOC_CONTENT_COUNT
-
A MAPI property containing the total number of messages in the mailbox.
-
PR_NT_USER_NAME
-
The Windows NT user account name of the last user to log on to the information store.
-
PR_LAST_LOGON_TIME
-
The date and time when the user last logged on to the information store.
-
PR_LAST_LOGOFF_TIME
-
The date and time when the user last logged out of the information store.
-
PR_STORAGE_LIMIT_INFORMATION
-
Contains information about whether a mailbox is currently within the storage limit set by the Administrator program.
-
PR_INSTANCE_KEY
-
A MAPI property containing a unique key identifying the mailbox (and a row in the table).
See Also
IExchangeManageStore