Finding a Profile Name

Clients sometimes need to find the name of the profile currently being used for the session, the name of the default profile, or the name of an alternate profile installed on the workstation.

There are a few ways to retrieve the name of a profile during the course of a session. If you need to find the name of a profile that is not necessarily the one being used for the session, use the first procedure. If you need to find the name of the default profile, use the second procedure. If you need to find the name of the current profile for the session, use one of the last two procedures.

    To find the name of any profile
  1. Call MAPIAdminProfiles to retrieve an IProfAdmin interface pointer.
  2. Call IProfAdmin::GetProfileTable to access the profile table.
  3. Call the profile table's IMAPITable::QueryRows method to retrieve all of the rows in the table and examine each one to determine if it represents your target profile.
    To find the name of the default profile
  1. Call MAPIAdminProfiles.
  2. Call IProfAdmin::GetProfileTable to access the profile table.
  3. Build a property restriction with an SPropertyRestriction structure to match PR_DEFAULT_PROFILE with the value TRUE.
  4. Call IMAPITable::FindRow to locate the row in the profile table that represents the default profile. The PR_DISPLAY_NAME column contains the name of the default profile.
    To find the name of the current profile

-Or-