Use the following commando to disable OWA and Activesync for everyone :
get-Mailbox -ResultSize Unlimited| set-CASMailbox -ActiveSyncEnabled:$False -OwaEnabled:$False
You can then create an CSV to enable OWA and Activesync for specific users :
Create a CSV with one column named UserPrincipalName and below it the users defined for which it needs it be active: import-csv c:\ActiveSync.csv | foreach-object {set-CASMailbox -identity $_.UserPrincipalName -…