Getting/Setting OOO (Out of Office) emails are mostly happening with Leavers who left the company on short notice or being kicked out of the Company. Where the account needs to be receiving emails but the other users should be informed about the User that has left the organization and future mails to the mentioned email. The below scripts will show you how to get and set OOO.
Get-Mailbox "User's Email address"| Get-MailboxAutoReplyConfiguration | Select AutoReplyState, InternalMessage
Set Out of Office is pretty straight forward and can you massively if you want to set for a set of mailboxes.
Set-MailboxAutoReplyConfiguration -Identity "user name"-AutoReplyState Enabled -InternalMessage "Out of office mails for Internal staffs" -ExternalMessage "Out of Office mail for anyone Outside the Organization."
