When you need to enable or disable specific mailbox features — OWA, ActiveSync, IMAP, POP — for a whole department or site, doing it mailbox-by-mailbox in the EAC is slow. Exchange PowerShell lets you target every mailbox in a given Organizational Unit in one pass.
Example — Disable IMAP and POP for an OU
Get-User -OrganizationalUnit "contoso.com/Sales" -ResultSize Unlimited | Get-Mailbox | Set-CASMailbox -ImapEnabled $false -PopEnabled $false
Example — Re-enable OWA for the Same OU
Get-User -OrganizationalUnit "contoso.com/Sales" -ResultSize Unlimited | Get-Mailbox | Set-CASMailbox -OWAEnabled $true
Get-User -OrganizationalUnit scopes the pipeline to accounts in that specific OU (not sub-OUs unless you target the parent and the child accounts happen to live directly under it), Get-Mailbox filters that down to only the objects that actually have a mailbox, and Set-CASMailbox applies the client access settings. Swap in -ActiveSyncEnabled $false or any of the other Set-CASMailbox switches as needed for your specific feature.
Always test the Get-User -OrganizationalUnit ... | Get-Mailbox portion on its own first (without piping into Set-CASMailbox) to confirm it returns exactly the mailboxes you expect before making the change.
Resources
Gear We Recommend
A few general tech accessories worth having alongside this.
Browse our General Tech Accessories picks on AmazonAs an Amazon Associate, TechyGeeksHome earns from qualifying purchases.
Discover more from TechyGeeksHome
Subscribe to get the latest posts sent to your email.