To disable OWA and EAS for all users:
get-casmailbox | set-casmailbox -OwaEnabled $false -ActiveSyncEnabled $false
You can filter users based on different parameters, including Exchange
server, mailbox database, department, location, distribution group
membership, etc., and pipe them to Set-CASMailbox command to disable both
OWA and EAS for those users.