This VB script will do the configuration for both Outlook 2003 and Outlook 2007. This script basically aims at changing the registry entries for your Outlook Profile that do all the outlook over https or outlook anywhere configuration.
Here are the Registry Keys and values that we are targetting at for doing this configuration in an Outlook Profile:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\
"00036601" - for Cached Mode
"00036623" - Enable Exchange Proxy settings and control various check boxes like "on fast networks…" etc.
"00036627" - For Authentication - Basic or NTLM
"001f6622" - for specifying Exchange proxy server name
"001f6625" - for specifying Exchange proxy server name according to principal cert name.
So the script will go like:
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strValue1Name = "00036601"
arrValue1 = Array(&H00,&H00,&H00,&H00)
strValue2Name = "00036623"
arrValue2 = Array(&H00,&H00,&H00,&H00)
strValue3Name = "00036627"
arrValue3 = Array(&H00,&H00,&H00,&H00)
strValue4Name = "001f6622"
arrValue4 = Array(&H00,&H00,&H00,&H00)
strValue5Name = "001f6625"
arrValue5 = Array(&H00,&H00,&H00,&H00)
strKeyPath = "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
oReg.EnumKey HKEY_CURRENT_USER, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
strFullPath = strKeyPath & "\" & subkey & "\13dbb0c8aa05101a9bb000aa002fc45a"
oReg.SetBinaryValue HKEY_CURRENT_USER,strFullPath,strValue1Name,arrValue1
oReg.SetBinaryValue HKEY_CURRENT_USER,strFullPath,strValue2Name,arrValue2
oReg.SetBinaryValue HKEY_CURRENT_USER,strFullPath,strValue3Name,arrValue3
oReg.SetBinaryValue HKEY_CURRENT_USER,strFullPath,strValue4Name,arrValue4
oReg.SetBinaryValue HKEY_CURRENT_USER,strFullPath,strValue5Name,arrValue5
Next
Replace the value of 00 after &H in arrValue1, arrValue2, arrValue3, arrValue4 and arrValue5 with your values by looking into the registry under mentioned reg keys.