I have been tasked to generate a report that will show if cached Exchange Mode is enabled in Outlook. I am currently searching for the best way to do this but my luck has been limited. I need this to be able to work on any version of Outlook. Has anyone done anything like this?
This is very difficult. Profiles are stored in HKEY_CURRENT_USER\Software\Microsoft\Office\<version>\Outlook\Profiles however it's all binary data. Also, there can be multiple profiles, and you have no way of knowing which one the user may have selected for any given session; also not all profiles are even Exchange-based, they may be imap, outlook.com, pop3, etc. or even a 'no mail' profile.
Your options are to enforce cached mode on/off using group policy (so you know which mode is always set/forced),
or, query the exchange server using e.g. Get-LogonStatistics “UserName” | FL Name, ClientName, ClientMode
mode = 0/1/2 0 = 'unknown' and seems to indicate pre-Outlook 2003 or some other clients like blackberry. 1 = Online mode 2 = Cached mode
So for fun... This would be an indirect way...but i bet fairly accurate... search users profile (when user is logged on and outlook.exe is running) for OST file, if none, then online mode, if it exists grab the last modified date and check it against todays date... Outlook is generally used everyday, so that should be pretty accurate.
But doing it from the Exchange side as Craig mentioned is probably the best way.
This script may work for Outlook 2010 clients:
This has a bit more detail:
Thank you for your responses. It looks like this is going to be a difficult one to figure out to make it an easy review. I will check out the links and see which one works the best.