IExchangeManageStore::CreateStoreEntryID

The CreateStoreEntryID method allows applications or services that run with Administrator privileges to manage multiple mailboxes.

HRESULT CreateStoreEntryID(
  LPTSTR lpszMsgStoreDN, 
  LPTSTR lpszMailboxDN,  
  ULONG ulFlags,         
  ULONG * lpcbEntryID,   
  LPRENTRYID * lppEntryID   
);
 

Parameters

lpszMsgStoreDN
Input parameter. Specifies the distinguished name of the information store where the mailbox is located. For example:
/o=ORG/ou=SITE/cn=Configuration/cn=Servers/cn=ThisServer
/cn=Microsoft Private MDB

lpszMailboxDN
Input parameter. Specifies the distinguished name of the mailbox your service is attempting to access.
ulFlags
Input parameter. Defined values that control what gets opened. Use the bitwise OR operator (|) to enable multiple operations:
OPENSTORE _HOME_LOGON
Opens the home logon of the user's information store. Should be used when a separate logon to the user's information store is required. For example, if your application tracks the Read status of messages in a public folder on a per-user basis, it must logon to the user's mailbox in addition to the public folder to mark certain items as Read.
OPENSTORE _OVERRIDE_HOME_MDB
Ignores the current home information store for the user. Use OPENSTORE_OVERRIDE_HOME_MDB to implement methods that move a mailbox or copy a mailbox to a server other than the home server of the user. You cannot create multiple mailboxes on different servers for a single user, unless you specify this flag.
OPENSTORE_PUBLIC
Opens the public information store.
OPENSTORE _TAKE_OWNERSHIP
Opens the information store as the owner of the store, using the identity of the owner of the store. Posts a security event to the event log.
OPENSTORE _USE_ADMIN_PRIVILEGE
Opens the information store of another user, if you have administration rights on the other information store. Allows your application to own the information store while it's running, but does not log you on the mailbox under the identity of the owner of the mailbox. Posts a security event to the event log. OPENSTORE_USE_ADMIN_PRIVILEGE is normally used in conjunction with OPENSTORE_TAKE_OWNERSHIP.
lpcbEntryID
Output parameter. The number of bytes returned in the entry identifier that is pointed to by lppEntryID.
lppEntryID
Output parameter. A pointer to the entry identifier.

Note If a user can use your application to browse their own folders, you must set the MDB_TEMPORARY and MDB_NO_MAIL bits in the ulFlags parameter to the MAPI IMAPISession::OpenMsgStore method.

Return Values

See Return Values.

Remarks

This method creates and returns an entry identifier that can be used to access a server mailbox using the MAPI IMAPISession::OpenMsgStore method. For more information, see the MAPI Programmer's Reference.

In addition, this method formats the entry identifier and does not access the information store or require any resources on the server. As a result, this method call is a relatively inexpensive operation. Your application should free the entry identifier after it has finished using it.

See Also

IExchangeManageStore