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 firstname.lastname@example.org -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
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.