Type this command in PowerShell on on-premise Exchange to disable OWA for all mailboxes:
get-casmailbox | set-casmailbox -OwaEnabled $false
You can re-enable OWA for individual mailboxes by running the following command:
get-casmailbox -identity (username) | set-casmailbox -OwaEnabled $true
Have used on Exchange 2007, 2010, 2013, 2016.
Jason works as a project specialist at an IT MSP in Pennsylvania, USA. He’s an IT/security professional with 20 years experience.