The HrMailboxLogon function logs on a server and mailbox.
Header file: | MBLOGON.H |
Library: | MBLOGON.LIB |
HRESULT HrMailboxLogon(
LPMAPISESSION lplhSession,
LPMDB lpMDB,
LPSTR lpszMsgStoreDN,
LPSTR lpszMailboxDN,
LPMDB * lppMailboxMDB
);
See Return Values.
This function is only intended for use by applications using the IExchangeManageStore::GetMailboxTable method to access other mailboxes in the system as a privileged service; for example, a voicemail application. See Logging On to a Mailbox as a Privileged Service. If this call is used, the account under which the application runs requires special permissions to function. Normal client applications should use the MAPILogonEx function to log on to a profile and gain access to an Microsoft Exchange-based mailbox.
Before calling the HrMailboxLogon function, perform the following steps:
The server and mailbox names must be in the form of distinguished names. For example:
/O=Organization/OU=Site/CN=Servers/CN=ServerName/CN=NULL
/O=Organization/OU=Site/CN=Container/CN=MailboxName
For more information on this function, see Logging On to a Mailbox as a Privileged Service and Using the IExchangeManageStore Interface.
For information on the IMAPISession and IMsgStore interfaces and obtaining DNs, see the MAPI Programmer's Reference.