Recently I made the move from Google Apps to Office 365. I love cloud services for mail, especially ones that allow 25G+ of mail storage. However, I was a bit shocked to find out that the default retention policy is set to 30 days. I basically never want my email deleted as I never know when I’m going to need a message later. Fortunately, with just a little PowerShell, this is easily fixable.
The first step is to get connected Office 365 via PowerShell. As Mike Pfeiffer shows us, this is easily accomplished with the following three PowerShell Commands:
$cred = Get-Credential
$s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $cred -Authentication Basic -AllowRedirection
$importResults = Import-PSSession $s
(The second command is all one line – formatting issues) :-)
Upon executing the first PowerShell command (Get-Credential) you’ll be prompted for a username and password. Use your Office 365 administrator’s credentials.
Then the command to disable the retention policy for the mailbox is as follows:
Set-Mailbox <name> -RetentionPolicy $null
Make sure the <name> is the email address for the mailbox you wish to disable the retention policy for. And fixed!
Very nice and helpful, there is so much information in the documentation that its hard to figure out what it is that you want. Is it possible to set this globally for all mailboxes, or do I need to do them one at a time? ( I have about 180 to do).
ReplyDeleteThanks so much for your time!
So many discussions about how to do this out there in the web - you brought it to the point! Thank you!
ReplyDelete