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?
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?
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:
7.0
8.0
9.0
10.0
11.0
12.0
14.0
(sic!)15.0
16.0
The above version info was copied from this answer.
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
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