Location: Articles

Articles

Articles

Enabling, Disabling and Reporting status of Outlook 2003 Cached Mode with GPO

By Matty Holland on Wednesday, November 28, 2007 4:22 PM

This article explains some of the options for centrally managing the Cached Exchange Mode setting on MAPI profiles provided through GPO Administrative Templates and a little custom scripting

 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 Policy Object 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.

 


Rating
Comments

By Exchange admin @ Thursday, April 24, 2008 10:02 AM

I used your instructions to force cached mode on new profiles but all the old profiles switched to cached mode too.
We have almost 2000 users with huge mailboxes and a great deal of them started synchronizing at the same time. Outlook and exchange are unusable at the moment as this is still happening and I'll be lucky to keep my job.


By Will Owen @ Wednesday, May 07, 2008 4:21 AM

Good job you tested the script in dev first then :-)


By SuperUser Account @ Thursday, May 15, 2008 3:15 PM

The script did exactly as described in this article : Using the GPO setting means only effective on newly created MAPI profiles. Using the script will set this on all MAPI profiles. Its all there in the article. Of course testing is important as well ;-)


By sheep @ Monday, August 11, 2008 6:46 PM

Nice work, helped me a lot. But i can´t get the vb script to run. I allways geht compilation error on Line 12 "statement excepted". I changed the upper value to true and modified the path to my log file. Since i dont understand vb i can´t determine where the error is.


By SuperUser Account @ Tuesday, August 12, 2008 1:52 PM

@Sheep: Glad you found it useful. The VBScript is corrected now.

Cheers, Matty


By sheep @ Wednesday, August 13, 2008 5:54 PM

hi, i couldn´t get it to work, but i found a solution that works fine for me.

Maybe someone finds it useful. Just import the registry key stated at this site:

http://www.howto-outlook.com/howto/cachedmoderegkey.htm

it ist "current user" so you can import it by "regedit /s regkey.reg" via logon script


By Jim @ Friday, October 03, 2008 3:26 PM

This doesnt seem to work for me. I have it setup as a login script, it seems to write to the log file, but it logs the same information regardless if i had cache enabled or disabled in the first place.

"Computer,user,MS Exchange Settings,Cached Mode Enabled"

And it doesnt enable cached mode in Outlook. It doesnt seem to be making any changes to Outlook (2003) at all.

Thanks


By 1000os @ Friday, February 13, 2009 3:36 AM

Hi,

thanks for this detailed & useful information, and most of all, a very nice script !

Worked like a charm to detect before major exchange migration the clients that had no cache !

Good jab and thanks for sharing,

1000os


By ryan k @ Thursday, September 10, 2009 4:53 PM

this seems to work for me only the first time i run it. when i try it on a different machine, the log says it works but it does not change to cached mode.

any ideas?


By ExchangeSurvivor @ Monday, November 16, 2009 6:36 PM

I tried the kix script. Work for the first profile row number 0. I'm not programmer oriented and wandering if you can repost a script when multiple profiles exist in the Profiles key folder.

Thanks for your post BTW!


By ExchangeSurvivor @ Monday, November 16, 2009 6:48 PM

I want to apologize from my last post. The script works perfectly. For a reason, the user I took to test had permission dednied to modify the key of one specific profile. Reason why I was hopping only works for the first profile.


By Paul Johnson @ Thursday, February 11, 2010 4:27 AM

Thank you for the info

Aaron K
<a href="http://webspacehosting.com">web hosting</a> MN


By Sharath @ Saturday, March 27, 2010 10:01 PM

Great job...Was very helpul


By Sharath @ Saturday, March 27, 2010 10:02 PM

Do you have any similar solution to change the exchange name. Without doing it manually


Click here to post a comment
Copyright 2009 ActiveDir.org
Terms Of Use