Office 365 Shared Mailbox Send on behalf of
- Ensure that the latest versions .NET Framework and Windows PowerShell are installed on your 64 bit Windows machine. These can be added via the Turn Windows features On or Off screen, which can be accessed via the search box on your Windows Start Menu or in Control Panel -> Programs and Features -> Turn Windows features On or Off,
- Download and install the Microsoft Online Services Sign-In Assistant
- Download and run the Azure Active Directory Module for Windows PowerShell
Once you’ve got everything setup, open up PowerShell and run the following script, altering where appropriate to suit your requirements/environment:
# Remove result limits due to console truncation
$FormatEnumerationLimit=-1
# Connect to Office 365. When prompted, login in with MSO credentials
Set-ExecutionPolicy Unrestricted -Force
Import-Module MSOnline
$O365Cred = Get-Credential
$O365Session = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $O365Cred -Authentication Basic -AllowRedirection
Import-PSSession $O365Session -AllowClobber
Connect-MsolService –Credential $O365Cred
# Add additonal users to Send on Behalf permissions for mailbox. add= list if a comma seperate list. Each email address should be in double quoted brackets
Set-mailbox ‘MySharedMailbox’ –Grantsendonbehalfto @{add="john.smith@domain.com"}
# Confirm that user has been succesfully added to send on behalf permissions for mailbox
Get-Mailbox 'MySharedMailbox' | ft Name,grantsendonbehalfto -wrap
# Display exit script (to keep window open in order to view the above)
Read-Host -Prompt "Press Enter to exit"