Personal tools
You are here: Home Software Distribution Control Outlook 2007 Caching Mode

Control Outlook 2007 Caching Mode

by jack — last modified 2007-10-23 13:41
Contributors: murthaj

Use StartAsUser.exe to tweak HKCU keys

One of LANDesk's superpowers is that it runs as LocalSystem; one of LANDesk's flaws is that it runs as LocalSystem. When you want to change things in HKey_Current_User, LocalSystem ain't gonna cut it. To do that, you need to use the StartAsUser.exe utility.

For an example, let's turn off Caching Mode in Outlook 2007.

@echo on
:: Turning Cached mode Off in Outlook 2007
C:\progra~1\LANDesk\LDClient\startasuser.exe ///silent ///timeout=300 reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Default Outlook Profile\13dbb0c8aa05101a9bb000aa002fc45a" /F /V 00036601 /T REG_BINARY /D 04100000

Note that StartAsUser.exe needs three slashes on its commandline switches to keep it from getting confused.


Schedule that as a required once policy and you're all set. To turn it back on, use:

@echo on
:: Turning Cached mode On in Outlook 2007
C:\progra~1\LANDesk\LDClient\startasuser.exe ///silent ///timeout=300 reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Default Outlook Profile\13dbb0c8aa05101a9bb000aa002fc45a" /F /V 00036601 /T REG_BINARY /D 8419000

Now let's get a little more complex. Imagine that in some alternate universe machines that upgrade from Outlook 2003 to Outlook 2007 choke on the first open of their .OST files unless CacheMode is turned off, but you want CacheMode on most of the time:

@echo on
:: Turning Cached mode Off in Outlook 2007
C:\progra~1\LANDesk\LDClient\startasuser.exe ///silent ///timeout=300 reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Default Outlook Profile\13dbb0c8aa05101a9bb000aa002fc45a" /F /V 00036601 /T REG_BINARY /D 04100000

:: Start outlook to open the .pst and .ost the first time
C:\progra~1\LANDesk\LDClient\startasuser.exe ///silent ///timeout=300 outlook.exe

::Stop Outlook
C:\progra~1\LANDesk\LDClient\startasuser.exe ///silent ///timeout=300 taskkill.exe /im outlook.exe

:: Turning Cached mode On in Outlook 2007
C:\progra~1\LANDesk\LDClient\startasuser.exe ///silent ///timeout=300 reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Default Outlook Profile\13dbb0c8aa05101a9bb000aa002fc45a" /F /V 00036601 /T REG_BINARY /D 84190000

You might need a sleep in between starting and killing Outlook, but for the most part this ought to do you. Make it a batch file and put it into your dependency chain for the Office 2007 upgrade.

Server Says:
War is never imperative.
-- McCoy, "Balance of Terror", stardate 1709.2
Safety First!
203 Days without a Dumpster fire.
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: