11

I need to write a VBScript code to check whether outlook is using MAPI profile or RPC over HTTP/S profile.

Which registry key decides the same?

3
  • These settings are controlled by settings in the registry. You need to find which registry keys are responsible for the settings...then check them with vbscript. You should rephrase your question to ask which registry keys determine the profile. You should check "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
    – Eugene
    Nov 24, 2012 at 18:07
  • Yes Thanks. Also post as an answer if you come to know about the registry keys which control the profile.
    – TechGeek
    Nov 24, 2012 at 21:19
  • You need to be more specific...which outlook version and which OSes? It looks like you want to check client-side...is there a reason for this? here is how you can check serverside. Also, not sure if applicable to you, but there are some changes in Exchange 2013 that will require all MAPI connections to be encapsulated using RPC-over-HTTPS.
    – Eugene
    Nov 25, 2012 at 0:06

3 Answers 3

19

This has changed in Outlook 2013:

Profiles are stored under keys:

HKEY_CURRENT_USER\Software\Microsoft\Office\<version>\Outlook\Profiles

Where <version> is one of the following:

  • Office 97 – 7.0
  • Office 98 – 8.0
  • Office 2000 – 9.0
  • Office XP – 10.0
  • Office 2003 – 11.0
  • Office 2007 – 12.0
  • Office 2010 – 14.0 (sic!)
  • Office 2013 – 15.0
  • Office 2016 – 16.0

The above version info was copied from this answer.

1
  • 5
    No, this is wrong. Profiles are stored on per-version basis only starting with Outlook 2013 (15). Prior to that the profiles are in HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles Sep 3, 2015 at 15:25
10
+25
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook


HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Simple MAPI-CMC
1
  • "Outlook" above is the profile name. It can be different depending on the profile name. The registry key is only valid in Outlook 2010 or older. Outlook 2013 and newer store profiles in a different key (see my reply above). Sep 5, 2015 at 17:19
7

Firstly, for Outlook 97-2010 the profiles are stored in HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles.

Starting with Outlook 2013 (which supports side-by-side installations), the profiles are stored in HKEY_CURRENT_USER\Software\Microsoft\Office\%version%\Outlook\Profiles, where %version% is 15.0 for Outlook 2013, 16.0 for Outlook 2016, etc.

On the low (Extended MAPI) level, RPC-over-HTTP (ROH) settings are determined by the ROHFLAGS_USE_ROH bit in the PR_PROFILE_RPC_PROXY_SERVER_FLAGS property (0x66230003). That property is set in the global profile section as well as the particular Exchange store profile section (since Outlook now supports multiple Exchange accounts in a single profile).

You can see the data in OutlookSpy (I am its author) - click IMAPISession button on the OutlookSpy ribbon, click OpenProfileSession, select the {C8B0DB13-05AA-1A10-9BB0-00AA002FC45A} pbGlobalProfileSectionGuid entry from the combo box.

Note that Extended MAPI cannot be used from VB (or .Net). If using Redemption/Profman (I am its author) is an option, you can use the following script to enumerate all profiles and check if ROH is used:

  PR_PROFILE_RPC_PROXY_SERVER_FLAGS  = &H66230003
  ROHFLAGS_USE_ROH = 1

  set Profiles=CreateObject("ProfMan.Profiles")
  for i = 1 to Profiles.Count
    set Profile = Profiles.Item(i)
    set GlobalProfSect = Profile.GlobalProfSect
    Debug.Print "Profile: " & Profile.Name & " ------"
    flags = GlobalProfSect.Item(PR_PROFILE_RPC_PROXY_SERVER_FLAGS)
    If TypeName(flags) = "Long" Then
      if (flags And ROHFLAGS_USE_ROH) = ROHFLAGS_USE_ROH Then
        Debug.Print "   ROH is used"
      Else
        Debug.Print "   ROH is not used"
      End If
    Else
      Debug.Print "   No PR_PROFILE_RPC_PROXY_SERVER_FLAGS"
    End If
  next

If you are already running Outlook and want to check that the current profile uses ROH, you can use RDOSession.ExchangeConnectionProperties.UseROH property:

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
MsgBox Session.ExchangeConnectionProperties.UseROH

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.