• Download our FREE True Price of Office 365 Whitepaper
  • Give us a call: 877-788-1617

    Stay in the know with the MessageOps newsletter:

    Tech Tip: Disable ActiveSync In Powershell By CSV, Single User and Attribute

    Our tech tip this week will help you in the process to enable/disable ActiveSync in Powershell by CSV, Single User and Attribute.

    Some organizations require for some users or vendors not to have ActiveSync enabled. Below are scripts on how to disable/enable ActiveSync by CSV, Attribute-based and by a single user. Disabling ActiveSync for users can also be done through Exchange Admin Center.

    Additional Sources:

    https://support.microsoft.com/en-us/help/2795303/how-to-disable-exchange-activesync-for-users-in-office-365

    Instructions:

    1) Connect to Exchange Online using the Windows Azure Powershell Module

    Enable ActiveSync For A Single User:

    Set-CASMailbox -Identity user@domain.com -ActiveSyncEnabled $True

    Disable ActiveSync For A Single User: 

    Set-CASMailbox -Identity user@domain.com -ActiveSyncEnabled $False

    Disable ActiveSync For A Group Of Users With AD Attribute Department Matching “Vendor”

    Get-User -RecipientTypeDetailsUserMailbox | where {$_.Department -eq “Vendor”} | Set-CASMailbox -ActiveSyncEnabled $False

    Enable ActiveSync For A Group Of Users With AD Attribute Department Matching “Vendor”

    Get-User -RecipientTypeDetailsUserMailbox | where {$_.Department -eq “Vendor”} | Set-CASMailbox -ActiveSyncEnabled $True

    Disable ActiveSync By CSV:

    Instructions:

    1. Create a CSV file name the top Column Users and under that column specify the users.
    2. Update the CSV path for the import and update the Log File path.

    Script:

    Import-CSV “C:\temp\ActiveSYNC.csv” | foreach {Set-CASMailbox -Identity $_.User -ActiveSyncEnabled $False} 2>> “c:\temp\Active-Sync-Disable-Logs.txt”

    Screen Shot Example Of CSV:

    Disable ActiveSync In Powershell

    Enable ActiveSync By CSV:

    Instructions:

    1. Create a CSV file name the top Column Users and under that column specify the users.
    2. Update the CSV path for the import and update the Log File path.

    Script:

    Import-CSV “C:\temp\ActiveSYNC.csv” | foreach {Set-CASMailbox -Identity $_.User -ActiveSyncEnabled $True} 2>> “c:\temp\Active-Sync-Enable-Logs.txt”

    Ready to get started? Contact us today to learn more.

    CONTACT US