Bulk Out of Office with PowerShell

Just a quick command to set an Out of Office reply through PowerShell. While we normally configure forwarding when offboarding staff, this particular customer only wanted out of office replies.

This example applies the policy to all mailboxes in an OU, but it can obviously be used for single users as well.

Get-Mailbox -OrganizationalUnit "FormerEmployees" | Set-MailboxAutoReplyConfiguration -AutoReplyState enabled -ExternalAudience all -InternalMessage "Thank you for your email, please direct your query to contact@domain.com.au as the recipient is no longer contactable" -ExternalMessage "Thank you for your email, please direct your query to contact@domain.com.au as the recipient is no longer contactable"