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 user@domain.com -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.
See also
Microsoft 365: Show Mailboxes that have Auto-Reply enabled
Microsoft 365: Add User Accounts and Mailboxes with PowerShell
Categories: Microsoft 365, PowerShell
Thank you for the article. Any chance to get this into a CSV?
LikeLike
Thank you. Try Export-csv
LikeLike
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.
Thanks
LikeLike
Nope, unfortunately no experience with this issue. Best, P
LikeLike