Search code examples
powershelloutlookoffice365exchange-server

Check who is Cached mode client - Exchange 2019 on premiss, Office365 Clients


In the last few days i was looking for a way to make report or gather information about all outlook users, which of them are using Chache mode, and who are connected online.

As mentioned in Title, we are working with Exchange 2019 on premiss, and all of our clients using Office365.

Here and there, i found few ways to find out about it, but all of thos ways are related to older server/client versions. like:

  1. Some scripts looking for some registry values. in specific - "00036601" key, but not only. because some offers other keys which supposed to be there for Office365 clients, but are not there in my case.
  2. Use Exchange Shell involving Get-LogonStatistics, but this cmdlet is not working in Exchange 2019.
  3. Proccess RPC Client Access Logs, but RPC connections are blocked in our network, and Outlook clients access the servers via HTTPS. tried to look into HTTP MAPI logs, but coudn't find there somthing that tells me weather the client is Cached mode or not.

The only way i've found that works, is to use client-side script, base on user identity, to load MAPI to Powershell and find out it's status:

$outlook = New-Object -com Outlook.Application
$namespace = $outlook.GetNamespace("MAPI")
$mailbox = $namespace.Stores | ? {$_.displayname.split("@")[0] -like $env:USERNAME}
$result = $env:USERNAME + ": " + $env:COMPUTERNAME + ": " + $mailbox.IsCachedExchange
$result | Add-Content -Path "\\server\Network-Shared-Folder\chache.txt"

if (!(Test-Path C:\users\$env:username\documents\cache)) {
   New-Item -ItemType Directory -Name cache -Path C:\users\$env:username\documents\
}

"Done" | Add-Content -Path C:\users\$env:username\documents\cache\testresult.txt

I can distribute this script with SCCM and some of the line i wrote for detection method. so i can run it also with Invoke-Command or other ways. But in the bottom line, i'm not eager to use this way, since it's involve the client side and identity, and can interfere with his own work on outlook.

I'm looking for different way, server-side preferably, to gather this information. Ofcource, something that is works with Exchange 2019 On-Premiss, and Office365 Clients which connecting via HTTPS.

Thanks for help. Yosi.


Solution

  • I don't think you can do that from the server - caching is client-only feature, plus a single Outlook profile can access the primary mailbox in the cached mode, but a delegate mailbox in on online mode.

    More than that, for some feature cached Outlook might open server objects in the online mode, e.g. when searching, and the user wants older items not cached locally.