Monday, 20 July 2015

Get ActiveSync Enabled Mailboxes using Powershell

We can get and list Exchange ActiveSync enabled mailboxes using the Powershell cmdlet Get-CASMailbox. In this article, I am going write Powershell script to get a list of ActiveSync Enabled Mailbox Users and Export ActiveSync Enabled User details to CSV file.

Before proceed, run the following command to enable Exchange Powershell cmdlets if you are working with Powershell console instead of Exchange Management Shell.
Add-PSSnapin *Exchange*

List Exchange ActiveSync enabled mailboxes:

The Get-CASMailbox cmdlet returns all the features for all the mailboxes users, we can use Where-Object and filter only users with Exchange ActiveSync Enabled.
Get-CASMailbox -ResultSize Unlimited | Where-Object { $_.ActiveSyncEnabled -eq $true}
You can add the parameter OrganizationalUnit if you want to list users from specific container (OU).
Get-CASMailbox -OrganizationalUnit $OU -ResultSize Unlimited |
Where-Object {$_.ActiveSyncEnabled -eq $true}

Export ActiveSync Enabled mailboxes to CSV:

The following powershell script exports all the ActiveSync enabled mailbox users to CSV file.
Get-CASMailbox -ResultSize Unlimited | Where-Object { $_.ActiveSyncEnabled -eq $true} |
Select Name,ActiveSyncEnabled,OWAEnabled |
Export-CSV "C:\\ActiveSyncEnabledUsers.csv" -NoTypeInformation -Encoding UTF8


No comments:

Post a Comment