Skip to content

Instantly share code, notes, and snippets.

#Obtain user credentials and connect to Exchange Online and import session commandlets
$userCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid -Credential $userCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
#Display summary message of the function of the script
Write-Host "This script will change the setting on a shared mailbox in Exchange Online for Office 365 to enable copies of mail sent from a shared mailbox by a user to be place in the SENT folder of the shared mailbox for compliance. By default this setting is disabled and the only copy of the sent message is stored in the sending users personal mailbox SENT folder."
#space for asthetics and to reduce clutter during reading
Write-Host " "