Platform SDK: Exchange Server

HrMailboxLogon

The HrMailboxLogon function logs on a server and mailbox.

Quick Info

Header file: MBLOGON.H
Library: MBLOGON.LIB

HRESULT HrMailboxLogon(
  LPMAPISESSION lplhSession,  
  LPMDB lpMDB,                
  LPSTR lpszMsgStoreDN,       
  LPSTR lpszMailboxDN,        
  LPMDB * lppMailboxMDB       
);
 

Parameters

lplhSession
Input parameter. Points to a MAPI IMAPISession interface containing the MAPI session handle.
lpMDB
Input parameter. Points to a MAPI IMsgStore interface containing message store.
lpszMsgStoreDN
Input parameter. Points to the information store distinguished name (DN).
lpszMailboxDN
Input parameter. Points to the mailbox DN. If NULL, HrMailboxLogon logs onto the public information store.
lppMailboxMDB
Output parameter. Points to an IMsgStore interface containing the mailbox information store.

Return Values

See Return Values.

Remarks

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:

  1. Create a profile that has administrator privileges.
  2. Log on to the profile with administrator privileges.
  3. Open the information store for that profile.

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.

See Also

HrMailboxLogoff