Create Exchange PowerShell Script to Modify Shared Mailbox Settings

exchangeexchange-2013powershellscripting

Following this guide: https://blogs.technet.microsoft.com/exchange/2015/03/03/want-more-control-over-sent-items-when-using-shared-mailboxes/

I must issue these commands in Exchange Powershell (Exchange Management Console):

set-mailbox <mailbox name> -MessageCopyForSentAsEnabled $True
set-mailbox <mailbox name> -MessageCopyForSendOnBehalfEnabled $True

However, I have a lot of shared mailboxes. I want don't want to have to issue this command 100 times. Is there a variable and/or script I can use for <mailbox name> which will let me automate this process for all shared mailboxes? (It's very important that I apply this to only shared mailboxes, and not just all mailboxes)

Best Answer

To get all the shared mailboxes in your environment, use:

Get-Mailbox -RecipientTypeDetails SharedMailbox

Running those commands against the results from this command should be trivial.

Related Topic