Posted by: David | May 13, 2011

VBS Script to disable Outlook Anywhere

So today I came across a requirement to disable Outlook Anywhere on all desktop computers.

From what I could find there isn’t an option to does this in the office adm templates and Microsoft did publish a hotfix (KB961112)¬†adm to allow the setting of RPC details, when specifying ‘no flags’ this does not seem to disable the check box for use Microsoft Exchange HTTP proxy.

Further research led me to discovering the aforementioned check box is controlled by a binary registry value in the HKEY_CURRENT_USER hive. If the value is present, the box is checked. So here is a little script to search for the value under each Outlook profile and delete it if present.

' Title: Disable RPC over HTTP
' Last Updated: 12/05/2011
' Written By: David Gardner
' Version: 1.0
' Description: VBS Script to Disable the check box for
' Connect to Microsoft Exchange using HTTP,
' tested on Outlookt 2007

'Set Constant for HKEY_CURRENT_USER
Const HKCU = &H80000001

'Create object to open regisrty on local computer
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!" _
& "\.rootdefault:StdRegProv")

'Set location and Binary Value when present enables checkbox
'in Outlook for "Connect to Microsoft Exchange using HTTP"
RPCBinaryValueName = "00036623"
strKeyPath = "SoftwareMicrosoftWindows NTCurrentVersion" _
& "Windows Messaging SubsystemProles"

'Enumerate all subkeys of strkeypath
objReg.EnumKey HKCU, strKeyPath, arrOutlookProfiles

'Disable RPC/HTTP for each Outlook profile
On Error Resume Next
For Each subkey In arrOutlookProfiles
On Error Resume next
strFullPath = strKeyPath & "" & subkey _
& "13dbb0c8aa05101a9bb000aa002fc45a"
objReg.GetBinaryValue HKCU,strFullPath,RPCBinaryValueName,arrValue1
arraysize = ubound(arrValue1)
if Err.Number 0 then
Wscript.quit 'If error code then RPC Value not present quite script
'disable RCP/HTTP
objReg.DeleteValue HKCU,strFullPath,RPCBinaryValueName
end if

Then I create a GPO and linked it to my Desktops OU enabled loopback processing and set the script as user log on script. Now none of my desktop users are configured for Outlook anywhere.



  1. Could you please make a script that runs on Outlook 2010.

    • Hey Johan,

      I have had a look, Outlook 2010 doesn’t use the same registy key for each profile so whilst the Binary value “00036623” is still used to determine the state of the check box its location moves from computer to computer.

      You would have to not only iterate through the HKCUSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles but also through every subkey of each profile where as with Outlook 2007 it was always located in the “13dbb0c8aa05101a9bb000aa002fc45a” subkey, this was not the case with Outlook 2010.

      It is easy to script this, however what I am not sure of is whether or not the “00036623” binary value is used for anything else by Outlook 2010 in those keys.

      I also had a look at the Office 2010 ADM files and these still dont offer the functionality to do this.

      You could also look at Office delpoyement and deploy Office 2010 via GPO with a customised installation settings for Outlook where I think it is possible to disable these settings.

      If I come across another way of doing this or any more information on the binary value for Outlook 2010 I will update the post.



  2. Heya juset wanted to gove you a quick heads up and let you know a few of the images aren’t
    loading properly. I’mnot suee why but I think its a linking issue.

    I’ve tried it in two different internet browsers and both show the
    same outcome.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: