Download the script
Managing Outlook Cache Mode through GPO appears first off to be an easy task. The Administrative Templates provided by MS to extend Group Policy for Office/Outlook (available for download here) can be used out of the box to restrict the related settings within Office/Outlook.
Note: If you already downloaded these templates then it’s always worth checking the MS Web Site for updates.
To define these settings you would use the policy highlighted in Figure 1. ‘Disable Cached Mode for all Profiles’. Although this setting is somewhat misleading. If you open the help text spreadsheet (provided with the ADM files for Office SP2) “Office 2003 Group Policies.xls” the help text shows us what this really means:
'Disables/Enables the option "Use Cached Exchange mode" in the E-mail Accounts dialog.’
So actually this setting Disables or Enables the ‘Option’ - the ‘Use Cached Exchange Mode’ checkbox. It doesn’t have an influence on the status of whether that check box is enabled or disabled.
Side note: when you open the “Office 2003 Group Policies.xls” spreadsheet, the setting ‘'Disable Cached Exchange Mode for all profiles’ is the default saved location in the spreadsheet? Strange? Could this be a coincidence or was the spreadsheet author aware that this setting was particularly confusing and was merely trying to save us some time?
We can also enforce a default Cached Exchange Mode for all new MAPI profiles (remembering a user can have multiple MAPI Profiles). This is the second policy highlighted in Figure 1. Again looking in the spreadsheet we will see
'Specifies the default Cached Exchange Mode for new profiles and disables the download options in the Cached Exchange Mode command submenu in the File menu. This applies only to Microsoft Exchange Server 2003.’
Figure 1. Policy with Outlook Administrative Template loaded (outlk11.adm)
Note: I’m using the Local Computer Policy as an example. Normally you would use a Group Policy object stored in the AD
Okay, so we have a fair bit covered by GPO already, what’s missing? If you are rolling out Office 2003 from scratch and wanted to enforce these settings then you could be happy to go with these settings as we would have nearly everything covered. But suppose we already have existing Outlook 2003 clients in our environment and Cached Mode was never forced by GPO in the past. We would have no idea how each MAPI profile was configured for each user.
As we saw, using GPO we can prevent a user from changing the Cached Exchange Mode setting and forcing a default for any new MAPI profiles they create, but we have no way to force the existing profiles to use Cached Exchange Mode.
If you are considering enforcing Cached Exchange Mode to all MAPI profiles in your organisation and want to be absolutely sure that indeed ALL MAPI profiles use Cached Exchange Mode then you will need to use a little scripting.
Within the ZIP attached to this article there are two scripts, one VBS, one KIX. They both do essentially the same thing. Organisations have differening Logon Script standards so here is a copy in both. This is where you will need to call this script from; your users logon script.
Both the scripts will toggle Cached Mode on/off for all MAPI profiles for a user. This is clearly an example since you wouldn’t want to do this in a live environment so the scripts can be changed accordingly to enable or disable Cached Mode for profiles depending on your requirements.
The KIX script below (CachedMode.KIX in the attached ZIP) has a little more functionality than the VBScript version since it will optionally create a report of all 'Cached Exchange Mode disabled' profiles in your organisation. This is useful to simply identify what you have out there already without impacting anything.
1. ; Author : Matty Holland
2. ; Purpose : Logs or enables / disables cache mode for MAPI profiles
3. ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4. Break on
5. $RC = SetConsole("HIDE")
6. $LogFile = "\\<youserver>\<yourshare$>\CacheMode\CacheMode.Log"
7. $ProfilesKey = "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
8. $OWCRegKeyName = "13dbb0c8aa05101a9bb000aa002fc45a"
9. $OWCRegValueName = "00036601"
10. $numDisabledValue = "04000000"
11. $numEnabledValue = "84010000"
12. $numEnabledValueWithPF = "84050000"
13. ? "PROCESS"
14. $i = 0
15. $Key = EnumKey($ProfilesKey, $i)
16. While $Key
17. ?"Profile found: $Key"
18. $j = 0
19. $SubKey = EnumKey($ProfilesKey + "\" + $Key, $j)
20. While $SubKey
21. if $SubKey = $OWCRegKeyName
22. $temp = ReadValue($ProfilesKey + "\" + $Key + "\" + $SubKey,$OWCRegValueName)
23. IF $temp <> 0 AND $temp <> ""
24. ;?"found: $temp"
25. $RO = RedirectOutput("$LogFile")
26. IF $RO = 0
27. select
28. CASE $temp = $numDisabledValue
29. ? @DATE + " " + @TIME + ",RegistrySetting," + @HOSTNAME + "," + @USERID + ",$Key,Cache Mode Disabled"
30. ;$RC = WriteValue($ProfilesKey + "\" + $Key + "\" + $SubKey,$OWCRegValueName,$numEnabledValue,"REG_BINARY")
31. CASE $temp = $numEnabledValue
32. ;? @DATE + " " + @TIME + ",RegistrySetting," + @HOSTNAME + "," + @USERID + ",$Key,Cache Mode Enabled"
33. ;$RC = WriteValue($ProfilesKey + "\" + $Key + "\" + $SubKey,$OWCRegValueName,numEnabledValue,"REG_BINARY")
34. CASE $temp = $numEnabledValueWithPF
35. ;? @DATE + " " + @TIME + ",RegistrySetting," + @HOSTNAME + "," + @USERID + ",$Key,Cache Mode Enabled With PF Favourites"
36. ;$RC = WriteValue($ProfilesKey + "\" + $Key + "\" + $SubKey,$OWCRegValueName,$numEnabledValue,"REG_BINARY")
37. endselect
38. endif
39. endif
40. endif
41. $j=$j+1
42. $SubKey = EnumKey($ProfilesKey + "\" + $Key,$j)
43. Loop
44. $i=$i+1
45. $Key = EnumKey($ProfilesKey,$i)
46. Loop
47. $RO = RedirectOutput("")
48. EXIT
A few things to note on the Kix script
For setting the script to logging only:
Line 6: you should change this path "\\<youserver>\<yourshare$>\ to a network file share in your organisation. All users should have read/write access to this share.
Line 30: Add a ‘;’ from the beginning of line
Line 33: Add a ‘;’ from the beginning of line
To enable cached mode on all clients using this script:
Line 30: Remove the ‘;’ from the beginning of line
Line 33: Add a ‘;’ from the beginning of line
To disable cached mode on all clients:
Line 30: Add a ‘;’ from the beginning of line
Line 33: Remove the ‘;’ from the beginning of line
If you are not familiar with Kixtart and you want to use the kix script, then you will need to download (for free) the Kix32 executable from here http://helpdesk.kixtart.org/Download.asp or see the vbs sample in the attached ZIP file.
To run a kix script use
Kix32.exe <pathtoscript>
Notes on the VBS Script
The VBScript supplied in the download with this article does the sme job as the Kix Script. A few things to mention when editing the script for your environment (you can use notepad or any text editor to do this):
Line 17: Configure the path to your log file - users must have read/write to this share
Const LogFile = \\yourserver\yourshare\yourlog.log
Line 20: Set EnableCacheMode to true to Set Cache Mode to enabled on clients where it is currently disabled
Const EnableCacheMode = false
Line 23: Set DisableCacheMode to true to to Set Cache Mode to Disabled on clients where it is currently enabled
Const DisableCacheMode = false
Setting both EnableCacheMode and DisableCacheMode to false put the script in logging only mode
Setting both EnableCacheMode and DisableCacheMode to true is an invalid configuration
To run a vbscript use:
cscript.exe <pathtoscript>
So with the combination of scripting to control Cached Mode for all existing MAPI profiles and Group Policy to restrict the user from changing these settings again in the future you are pretty well placed to manage/force this setting for outlook users.
Just a short note on OL 2007. I believe (but haven't tested) that in Outlook 2007 the GPO settings included in the new ADM files will allow controlling Cached Mode settings for all profiles, new and existing.