SOLVED: How to Apply an ActiveSync Policy To A Group

If you need to apply a particular ActiveSync policy to only a particular Distribution Group you can run (and modify) the following script.

# Put members of the Dist Group into a dynamic array
$allMembers = Get-DistributionGroupMember -Identity ‘<DISTRIBUTION GROUP NAME HERE>

# Loop through each person in the allMembers array
foreach ($member in $allMembers) {
# Set ActiveSync for each member of the array
$member | Set-CASMailbox -ActiveSyncEnabled $true
# Set ActiveSync Policy for each member of the array
$member | Set-CASMailbox -ActiveSyncMailboxPolicy “<ACTIVESYNC POLICY NAME HERE>
}

I stole most of this from ecktech.me/powershell-apply-activesync-policy-to-an-active-directory-group  so give him a click as he had more to say than I  🙂

This website uses cookies.