If you would like to disable OWA access for users in specified OUs, I suppose you may use the following command in Exchange Management Shell:
Get-mailbox -OrganizationalUnit "Contoso.com/Tailspintoys" | Set-CASMailbox -OWAEnabled:$false
It would disable OWA for all users in the Tailspintoys OU.
When users enter their credentials to log in OWA, they would see the following error:
You may also do it in Exchange Admin Center.
Here is a link on this topic for your reference: Enable or disable Outlook on the web access to mailboxes in Exchange Server
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.