HOWTO: Log On to Exchange with the ProfileInfo Parameter

ID: Q195662

The information in this article applies to:

SUMMARY

With CDO, you can log on to an Exchange Server mailbox using the ProfileInfo parameter. This article describes how to use the ProfileInfo parameter and why you would use it.

MORE INFORMATION

Description

The Logon method of the Session object has the following syntax:

   objSession.Logon( [profileName] [, profilePassword] [, showDialog]
       [, newSession] [, parentWindow] [, NoMail] [, ProfileInfo] )

You use the ProfileInfo parameter of the Logon method to create a temporary profile for the session. CDO generates a random name for the profile. For an authenticated profile, use the following format for the string:

   <server name> & vbLf & <mailbox name>

The server and mailbox names can be unresolved. Note that the mailbox name is not the messaging user's display name, but rather the alias or account name used internally by the user's organization.

For example, you should use "johnd" instead of "John Doe". The profile is deleted after the logon is completed or terminated. Only applications interfacing with Microsoft Exchange Server and no other services use the ProfileInfo parameter. The profileName parameter is ignored if ProfileInfo is supplied.

Reasons for Use

Use the ProfileInfo parameter in any of the following cases:

1. You do not know what profiles exist on a computer or you do not want to

   rely on them being there. This is very common when you run code from a
   Windows NT Service or Active Server Page.

2. You do not want to run the code that is required to determine the
   default profile for the current user. For information on determining the
   default profile, please see the following article in the Microsoft
   Knowledge Base:

      ARTICLE-ID: Q171422
      TITLE     : HOWTO: Logging on to Active Messaging Session w/ 
                  Default Profile

3. You want to allow users the ability to log on to the Exchange server
   without an authenticated Windows NT account and have anonymous access to
   Public Folders. For information on how to configure public folders for
   anonymous Web access, please see the following article in the Microsoft
   Knowledge Base:

      ARTICLE-ID: Q168661
      TITLE     : PRB: Accessing Public Folders Via a Web Browser Causes
                  Error

Sample Code

Additional query words:
Keywords          : kbCDO120 kbCDO121 kbMsg kbGrpMsg 
Version           : WINDOWS:1.2,1.21
Platform          : WINDOWS
Issue type        : kbhowto

Last Reviewed: April 7, 1999