Microsoft 365

Microsoft 365: Find and Show Active Sync Users

Active Sync allows users to connect their smartphone with Microsoft 365, respectively Exchange Online. Do you know which users have this feature enabled? If not, read on. I will give you a PowerShell one-liner to catch them all and save them for documenting purposes.

Connect to Microsoft 365 / Exchange Online

First we need to connect to our tenant. Run the commands below to open a PowerShell session to your Microsoft cloud.

Install-Module -Name ExchangeOnlineManagement -Force -AllowClobber

Connect-ExchangeOnline -UserPrincipalName -ShowProgress $true

Fine. Let’s move on.

Retrieve all Active Sync enabled Users

This first one-liner shows all Active Sync enabled users. Note that this doesn’t mean they have an actively established connection, it only means they are allowed to use Active Sync. This setting can be configured in your Microsoft 365 portal.

Get-ExoCASMailbox -ResultSize Unlimited `
-Filter "Name -notlike '*Discovery*' -and ActiveSyncEnabled -eq $true" |
Select-Object DisplayName,ActiveSyncEnabled

Anmerkung 2020-05-25 154115

Next objective is to show all users that have an active device partnership via Active Sync. This applies to devices and users that can be controlled with Microsoft 365.

Get-ExoCASMailbox -ResultSize Unlimited -PropertySets ActiveSync `
-Filter "HasActiveSyncDevicePartnership -eq $true" |
Select-Object DisplayName,ActiveSyncEnabled,HasActiveSyncDevicePartnership

Fine, that’s it. Now you have an overview who is using Active Sync.

See also

Microsoft 365: Show Mailboxes that have Auto-Reply enabled

Microsoft 365: Add User Accounts and Mailboxes with PowerShell


5 replies »

  1. Have you encountered an issue where the get-exocasmailbox command does not find a user who has connected mobile devices? For example, for my account I have had 2 mobile devices connected and syncing Outlook. When I run get-mobiledevice, it finds my mobile devices. However, if I run get-exocasmailbox and add the property for activesync it shows the HasActiveSyncDevicePartnership as False. Just wondered how that can be and if you have discovered this in the past.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.