Microsoft recommends to set the Microsoft 365 password expiration policy to never expire because password…
Enable or disable Exchange ActiveSync mailboxes
You can easily enable or disable ActiveSync for all users and export a list of all mailboxes, including their ActiveSync status, to a single CSV file. In this article, you will learn how to enable or disable Exchange ActiveSync mailboxes in the Exchange admin center (EAC) and with Exchange Online PowerShell.
Table of contents
Exchange ActiveSync access to mailboxes in Exchange Server
Exchange ActiveSync enables mobile phone users to access their email, calendar, contacts, and tasks. Moreover, it allows users to retrieve this information even while working offline.
By default, ActiveSync is enabled for new user mailboxes. However, disabling ActiveSync on a mailbox restricts users from synchronizing their mailbox with a mobile device through ActiveSync.
We will show you two ways to enable or disable Exchange ActiveSync access for a mailbox:
- Exchange admin center (EAC)
- Exchange Online PowerShell
Enable or disable ActiveSync mailbox in Exchange admin center
Time needed: 10 minutes
How to enable or disable Exchange ActiveSync in Exchange admin center (EAC)
- Go to Exchange admin center
Fill in your admin credentials and sign in Exchange admin center.
- Click Menu > Recipients
Expand Recipients.
- Go to Mailboxes
Click on Mailboxes.
- Search and select the user mailbox
Select a user mailbox from the list to open the display pane.
- The user mailbox display pane opens
Under the General tab, click on Manage email apps settings.
- Disable Mobile (Exchange ActiveSync)
Select the toggle next to Mobile (Exchange ActiveSync).
- Email app settings updated successfully
Click Save and close the display pane.
You can change the ActiveSync for every single mailbox. To apply these changes to multiple mailboxes, read the next step.
Bulk enable or disable ActiveSync mailboxes in EAC
Follow the below step to bulk enable or disable Exchange ActiveSync mailboxes:
- Sign into Exchange admin center
- Click Recipients > Mailboxes
- Select multiple users from the mailbox list
Note: Select multiple mailboxes by clicking on the dot in front of each mailbox. You can also hold the Ctrl key and click on the name of each mailbox you want to change. To select a list of mailboxes after each other, you must hold the Shift key and click on the first mailbox and the last mailbox.
- Click on Edit > App settings
- The display pane opens. Click the drop-down arrow next to Mobile (Exchange ActiveSync). Select Enable or Disable. The changes will be applied to the selected mailboxes.
- Click Save. You will get a notification message > Email app settings updated successfully. Close the display pane.
Enable or disable ActiveSync mailbox with PowerShell
To be able to run the PowerShell commands, you will need to Connect to Exchange Online PowerShell.
1. Start Windows PowerShell as administrator and run the Connect-ExchangeOnline cmdlet.
Connect-ExchangeOnline
We will use the Set-CASMailbox cmdlet to configure settings for Exchange ActiveSync.
2. Run the below PowerShell command to enable ActiveSync for a single user mailbox.
Set-CASMailbox -Identity "Amanda.Hansen@m365info.com" -ActiveSyncEnabled $True
3. Run the below PowerShell command to disable ActiveSync for a single user mailbox.
Set-CASMailbox -Identity "Amanda.Hansen@m365info.com" -ActiveSyncEnabled $False
Bulk enable or disable ActiveSync for all mailboxes
To enable or disable ActiveSync for the entire organization, we will use the Get-Mailbox cmdlet.
1. Bulk enable Exchange ActiveSync mailboxes for the organization with the below PowerShell command.
Get-Mailbox -ResultSize Unlimited | Set-CASMailbox -ActiveSyncEnabled $True
2. Run the below PowerShell command to bulk disable Exchange ActiveSync mailboxes for the entire organization.
Get-Mailbox -ResultSize Unlimited | Set-CASMailbox -ActiveSyncEnabled $False
Bulk enable or disable ActiveSync for users in a group
Let’s say that you have created groups in your organization. When you have a group of members in your organization, you can enable or disable Exchange ActiveSync for all these users in the group.
1. Run the below PowerShell command example to enable ActiveSync for the Sales Team.
$groupId = "Sales Team"
$members = Get-UnifiedGroup -Identity $groupId | Get-UnifiedGroupLinks -LinkType Members
foreach ($member in $members) {
$smtpAddress = $member.PrimarySmtpAddress
$casMailbox = Get-CASMailbox -Identity $smtpAddress -ErrorAction SilentlyContinue
if ($casMailbox -ne $null -and -not $casMailbox.ActiveSyncEnabled) {
Set-CASMailbox -Identity $smtpAddress -ActiveSyncEnabled $true
Write-Host "ActiveSync enabled for user: $smtpAddress"
}
}
Note: All the members in the group need to have a license. It will not enable ActiveSync for any member without a license.
ActiveSync enabled for user: Brenda.Smith@m365info.com
ActiveSync enabled for user: David.Kent@m365info.com
ActiveSync enabled for user: Susan.Brown@m365info.com
You can also bulk disable ActiveSync for the users in a group of your organization.
2. Use the below PowerShell command example to disable ActiveSync for the Sales Team.
$groupId = "Sales Team"
$members = Get-UnifiedGroup -Identity $groupId | Get-UnifiedGroupLinks -LinkType Members
foreach ($member in $members) {
$smtpAddress = $member.PrimarySmtpAddress
$casMailbox = Get-CASMailbox -Identity $smtpAddress -ErrorAction SilentlyContinue
if ($casMailbox -ne $null -and $casMailbox.ActiveSyncEnabled) {
Set-CASMailbox -Identity $smtpAddress -ActiveSyncEnabled $false
Write-Host "ActiveSync disabled for user: $smtpAddress"
}
elseif ($casMailbox -eq $null) {
Write-Host "User $smtpAddress does not have a license."
}
else {
Write-Host "ActiveSync is already disabled for user: $smtpAddress"
}
}
Note: All the members in the group need to have a license. It will not disable ActiveSync for any user mailbox without a license.
ActiveSync disabled for user: Brenda.Smith@m365info.com
ActiveSync disabled for user: David.Kent@m365info.com
ActiveSync disabled for user: Susan.Brown@m365info.com
Bulk enable or disable ActiveSync for multiple users
There is another way to enable or disable Exchange ActiveSync for multiple users, but you need the users’ mailbox names.
1. Use the below PowerShell command example to enable ActiveSync for multiple user mailboxes.
$users = "Brenda.Smith@m365info.com", "Chris.Lucas@m365info.com", "David.Kent@m365info.com", "Diana.Baker@m365info.com"
foreach ($user in $users) {
Set-CASMailbox -Identity $user -ActiveSyncEnabled $True
}
2. Use the below PowerShell command example to disable ActiveSync for multiple user mailboxes.
$users = "Brenda.Smith@m365info.com", "Chris.Lucas@m365info.com", "David.Kent@m365info.com", "Diana.Baker@m365info.com"
foreach ($user in $users) {
Set-CASMailbox -Identity $user -ActiveSyncEnabled $False
}
Enable or disable ActiveSync with CSV file
To enable or disable the ActiveSync of user mailboxes, you need to create a single CSV file.
Open Notepad and type the below data to enable ActiveSync:
- Type User at the top
- Type a list of the user mailboxes
The below picture is an example of how your CSV file should look like.
- Name the file EnableActiveSync.csv in C:\temp
- Save as type All files (*.*)
- Click Save
You will see the Notepad CSV file in your folder.
To ensure that PowerShell can read the file, run the Import-Csv cmdlet.
Import-Csv "C:\temp\EnableActiveSync.csv"
Run the below PowerShell script to enable ActiveSync for selected user mailboxes from a CSV file.
Import-Csv "C:\temp\EnableActiveSync.csv" | foreach {Set-CASMailbox -Identity $_.User -ActiveSyncEnabled $True}
You can also disable ActiveSync with a CSV file.
Create a CSV file in Notepad:
- Type User at the top
- Type a list of user mailboxes you want to disable ActiveSync
- Name the file DisableActiveSync.csv and save type as All files (*.*) in the C:\temp
You will see the Notepad CSV file in the same folder as the one you created before.
Run the below PowerShell script to disable ActiveSync for selected user mailboxes from a CSV file.
Import-Csv "C:\temp\DisableActiveSync.csv" | foreach {Set-CASMailbox -Identity $_.User -ActiveSyncEnabled $False}
Verify Exchange ActiveSync access to mailboxes
To verify you enabled or disabled Exchange ActiveSync, go to Exchange admin center > Recipients > Mailboxes. You must click on each user mailbox to check whether ActiveSync is enabled or disabled.
Or you can use the below PowerShell example to display ActiveSync for a single mailbox.
Get-CASMailbox -Identity "Amanda.Hansen@m365info.com" | ft Displayname, ActiveSyncEnabled
The PowerShell output shows the below result.
PS C:\> Get-CASMailbox -Identity "Amanda.Hansen@m365info.com" | ft Displayname, ActiveSyncEnabled
DisplayName ActiveSyncEnabled
----------- -----------------
Amanda Hansen False
To check and display all Exchange mailboxes with their ActiveSync status, you must use PowerShell.
Get-CASMailbox -ResultSize Unlimited | ft DisplayName,ActiveSyncEnabled
The PowerShell output shows a list of ActiveSync enabled (True) or disabled (False) of all mailboxes.
PS C:\> Get-CASMailbox -ResultSize Unlimited | ft DisplayName,ActiveSyncEnabled
DisplayName ActiveSyncEnabled
----------- -----------------
Amanda Hansen False
Brenda Smith False
Chris Lucas False
David Kent False
Diana Baker False
Discovery Search Mailbox True
George Wilson True
Info Box True
Jill Bates False
Julia Wood True
Kelly Test True
Mary James True
Project Pool 11 True
Projector 21 True
Projector 8 True
René Gibs False
Room01 True
RoomTest8 True
Stephen Hunter True
Susan Brown False
Export list ActiveSync mailboxes to CSV
You can also export ActiveSync data of all mailboxes to a single CSV file. This way, you can easily search ActiveSync for all mailboxes.
Use the below PowerShell example command:
Get-CASMailbox -ResultSize Unlimited | Select-Object DisplayName,ActiveSyncEnabled | Export-Csv "C:\temp\Export ActiveSync.csv" -Encoding UTF8 -NoTypeInformation
Once you export the information, you can find the CSV file in the C:\temp folder.
Open the CSV file with an application like Microsoft Excel to see the results.
That’s it!
Read more: Manage user mailbox with PowerShell »
Conclusion
You learned how to enable or disable Exchange ActiveSync to mailboxes in Exchange admin center (EAC) and Exchange Online PowerShell. In EAC, you can bulk enable or disable ActiveSync for all users. With PowerShell, you can also export a list of all mailboxes and their ActiveSync status to a single CSV file.
Did you enjoy this article? You may also like to How to improve Microsoft Entra MFA security. Don’t forget to follow us and share this article.
This Post Has 0 Comments