Advertisement

By default all users are allowed to use Outlook Web Access, also called OWA. It is possible to disable access to OWA and the users can still access their mailbox via email clients like Outlook or Thunderbird.

Manually checking the status or disabling it can be very time-consuming. So we will simply use the Exchange Management Shell to do so.

Advertisement

If you want to see all users where Outlook Web Access is disabled, use this command:

Get-CASMailbox -ResultSize Unlimited | where{$_.OWAEnabled -like "False"}

Of course it is also possible to enable it with nearly the same command, but with the Set-CASMailbox command like that:

Get-CASMailbox -ResultSize Unlimited | where{$_.OWAEnabled -like "False"} | Set-CASMailbox -OWAEnabled $true

Filtering for one specific user works with the “Identity” parameter:

Set-CasMailbox -Identity "Test User" -OWAEnabled $false

Another convenient and very useful way to use this command is by filtering for an organizational unit (OU).

$NAFinance = Get-Mailbox -OrganizationalUnit "OU=myBranch,OU=myCountry,DC=mydomain,DC=com" -Filter {RecipientTypeDetails -eq 'UserMailbox'} -ResultSize Unlimited; $NAFinance | foreach  {Set-CasMailbox  $_.Identity -OWAEnabled $false}

Advertisement
Previous articleSending an email within a PowerShell script
Next articleHow to change an expired Windows password via remote desktop protocol (RDP)?

LEAVE A REPLY

Please enter your comment!
Please enter your name here