Enabeling and Disabiling Active Sync for the user

Windows Mobiles can be configured for Active Sync. Active Sync is enabled for all users by Default in Exchange 2007. For Security reasons its recommended to disabled all users and enable only for the required users

Below power shell enabled and disabled Active for all the users in the exchange Organization

get-Mailbox -resultsize unlimited | set-CASMailbox -ActiveSyncEnabled:$False

get-Mailbox -resultsize unlimited | set-CASMailbox -ActiveSyncEnabled:$True

Below powershell command to enable and disable active sync for given set of users in the text file

Get-content C:\users.txt | set-CASMailbox -ActiveSyncEnabled:$True

Get-content C:\users.txt| set-CASMailbox -ActiveSyncEnabled:$True

Below powershell command to get the list of users who ActiveSync is Enabled and Disabled

Get-CASMailbox -ActiveSyncEnabled:$True

Get-CASMailbox -ActiveSyncEnabled:$False

3 thoughts on “Enabeling and Disabiling Active Sync for the user

  1. To satisfy our needs I had to write this script, I run it once per week just to keep things in check. I add users who are granted EAS access to an AD group. This script will disable EAS for everyone momentarily, but I don’t really see it as a problem when it’s running at 4am on Sunday morning.

    #Adding Exchange Snap In to execute Exchange CmdLets in this script
    Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin

    # Disable ActiveSync for ALL accounts because Microsoft hates you
    get-Mailbox -ResultSize:unlimited | set-CASMailbox -ActiveSyncEnabled:$False -ErrorAction SilentlyContinue -WarningAction SilentlyContinue

    # Assign all members of the group to a dynamic array
    $allUsers = Get-DistributionGroupMember -Identity ‘ActiveSync Users’

    # Loop through the array
    foreach ($member in $allUsers) {

    # Set ActiveSync for each member of the array
    $member | Set-CASMailbox –ActiveSyncEnabled $true
    }

  2. #Adding Exchange Snap In to execute Exchange CmdLets in this script

    Sounds good. But where can I get this SnapIn? Thx.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s