For many organizations, ActiveSync plays a big part in terms of communication where end users either have email on company owned devices or personal devices.

Policies can be applied to certain users, for example, Executives or Senior Management may have a different Mobile device policy than what end users have. For a client recently I put together a quick script that could be exported to a CSV file to show if the default policy is assigned or specific ones to users.

In the command below, we make use of the Get-CASMailbox command (This was also tested against mailboxes in Office 365 and it provided the info), Here is the command used:

Get-CASMailbox | where{$_.activesyncmailboxpolicy -match “”} | Select Name,PrimarySmtpAddress,ActiveSyncMailboxPolicy,ActiveSyncMailboxPolicyIsDefaulted

Below is a screenshot of the output:

Exchange 2016/2019:- display the top 10 largest mailboxes

As this is a test lab, your organization may have hundreds if not thousands of users and a screen display will show a lot of information, we can use the same command but export it to a CSV file as below:

Get-CASMailbox | where{$_.activesyncmailboxpolicy -match “”} | Select Name,PrimarySmtpAddress,ActiveSyncMailboxPolicy,ActiveSyncMailboxPolicyIsDefaulted | Export-Csv  “C:\Users\ActiveSyncPolicy.csv

Here is a screenshot of the command run, notice it does not give any information after it has run but the CSV file is exported:

Exchange 2016/2019:- display the top 10 largest mailboxes

This is what the sample CSV file looks like, some information has been removed:

Exchange 2016/2019:- display the top 10 largest mailboxes

Hope it helps.

Discover more from Everything-PowerShell

Subscribe now to keep reading and get access to the full archive.

Continue reading