MSExchangeGuru.com

Learn Exchange the Guru way !!!

 

Listing ExchangeActiveSync users assigned to a specific ActiveSync policy

This process outlines the steps to find all users in an organization assigned to a particular ActiveSync policy

  • Exchange ActivePolicy Name used here is “Admins”
  1. First you need to specify a “variable” for the name of the policy which you wish to extract a report. If you skip this step, you will end up querying ActiveSync mailbox policy for all users in the organization.

To do so, open the exchange management shell and type:

$ActiveSyncPolicyName = (Get-ActiveSyncMailboxPolicy “Admins“).Identity.DistinguishedName

Here, replace Admins with the name of your ActiveSync policy

  1. Now, run the cmd-let which will extract “only” the users assigned with the policyname “Admins”. For ease, ft it to the parameters as shown:

Get-CASMailbox -Filter {ActiveSyncMailboxPolicy -eq $ActiveSyncPolicyName} |ft Displayname, ActiveSyncMailboxPolicy, Servername

DisplayName ActiveSyncMailboxPolicy ServerName
———– ———————– ———-
Affleck, Ben Admins Exch2
Lee, Bruce Admins Exch5
Rajan, Sunder Admins Exch1
Keating, Ronan Admins Exch1
Ronald, Allen Admins Exch1
Nair, Meera Admins Exch5
Nair, Ratish Admins Exch3

So as you can see, these are the list of users assigned the Exchange ActiveSync policy named “Admins”

Ratish Nair
MVP Exchange
Team@ MSExchangeGuru

Keywords: Get list of users assigned to an activesync policy, Get-ActiveSyncMailboxPolicy list of users, list of users using one activesync policy.

7 Responses to “Listing ExchangeActiveSync users assigned to a specific ActiveSync policy”

  1. Kjell Andorsen Says:

    Ratish,

    It’s funny, I just had a need to do this the other day and had to write my own snippet of powershell to accomplish it. I tried a slightly different approach where the variable doesn’t have to be declared before hand

    Get-CASMailbox | where{$_.activesyncmailboxpolicy -match “”}

  2. Kjell Andorsen Says:

    Ooops, guess it didn’t like my formatting. between the double quotes you would put the name of the activesync policy you’re needing so to use your example of admins it would be Get-CASMailbox | where{$_.activesyncmailboxpolicy -match “Admins”}

  3. BlackBerry 10 HoneyMoon is over … | Serious Mobile Says:

    […] Listing ExchangeActiveSync users assigned to a specific ActiveSync policy. (cmdlet […]

  4. David Reller Says:

    I recently needed to pull all users with a particular ActiveSync policy. With over 100k mailboxes in our environment, this is exactly what I was looking for! Since I’m not an “Exchange guy” anymore, but script quite a bit of PowerShell for AD, I would have been fumbling thru the various Exchange PS cmdlets for hours. Thank you very much for posting this blog entry!

  5. Ben Says:

    I took Kjell’s one liner and took it a little further. This will grab only the mailboxes with Active Sync enabled, as they are the only ones I care about, and output their name and the policy they are attached to:

    Get-CASMailbox | where {$_.ActiveSyncEnabled -eq “True”} | Select-Object Name,ActiveSyncMailboxPolicy |Sort-Object ActiveSyncMailboxPolicy

  6. Mahmoud Says:

    Could you please helping me in how to Set Mailbox ActiveSync Policy for users in specific OU?

  7. Mahmoud Says:

    i got this script but not working with me, also i don’t know if $sam is mean the exchange host or not also i dont know where i can putting my ative sync policy in these mentioned script

    foreach ($user in (
    get-user -organizationalunit “ou=users,ou=santa clara,dc=zohno,dc=com”)) {
    $sam = $user.samaccountname
    Set-CASMailbox -identity $sam -ActiveSyncMailboxPolicy (Get-ActiveSyncMailboxPolicy “All Users Active-Sync Policy”).Identity
    #Write-Host $sam
    }

Leave a Reply

Categories

Archives

MSExchangeGuru.com