Link to home
Start Free TrialLog in
Avatar of Bolt Burdon
Bolt BurdonFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Help with 365 Retention policies

Hi,

This is my first post here, although I've been using Expert Exchange for years at a different company.

 

We have an on-premise DC and Azure AD Connect.

 

I've been tasked with creating a retention policy that will perform the following:

 

1.) Remove items from a user's Junk folder after 30 days

2.) Remove items from a user's Sent Items after 90 days

3.) Remove items from a user's Deleted Items after a period of time (not decided yet)

 

I need to be able to assign this on a per-mailbox basis without user intervention.

 

I've tried Exchange (legacy) retention policies, but these don't seem to work, and I'd rather use Data Lifecycle Management labels and the auto-apply a label function.

 

But I am now stuck, so three questions:

 

1.) Is the auto-apply a label function only available with Microsoft Purview solutions?

2.) How do I manually attach a Data Lifecycle Management label to an Outlook folder?

3.) For Exchange (legacy), does one have to run any PowerShell scripts, or should they work by just attaching to a user's mail box?

 

Any help is greatly appreciated.

 

Thanks.

Avatar of FOX
FOX
Flag of United States of America image

If these are for you mailboxes that reside in o365 I would stick to the Legacy retention policies
1. Create your policy tags for the below
1.) Remove items from a user's Junk folder after 30 days
2.) Remove items from a user's Sent Items after 90 days
3.) Remove items from a user's Deleted Items after a period of time (not decided yet)

Then create your retention policy - Name it whatever you want.
Add the retention tags to the retention policy you created.

Once done set the mailbox retention policy on the mailboxes in question.
Once you set the retention policy on the mailbox you may want to kick it in using the below powershell command from Exchange online powershell

Start-ManagedFolderAssistant "emailaddressoftheuserinquestion"


Avatar of Bolt Burdon

ASKER

Hi Fox,

Thanks for coming back to me.

So I tried the script from this web site https://www.tachytelic.net - Think it should be fairly easy however it failed and I don't know why.

This is the script I ran
$Cred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic -AllowRedirection
Import-PSSession $Session
Start-ManagedFolderAssistant "OurUseretchere"
Remove-PSSession $Session

Then thi is the error message I got back

New-PSSession : [ps.outlook.com] Connecting to remote server ps.outlook.com failed with the following error message :
Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:12
+ $Session = New-PSSession -ConfigurationName Microsoft.Exchange -Conne ...
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
   gTransportException
    + FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed

I tried this first before coming on EE and I couldn't figure out what the above script meant or how to resolve it.

Any help guidance great appreciated.

Ian


Did you install the powershell module for exchange on that machine you are using?

https://learn.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view=exchange-ps
No I did not - would that have caused the issue?

I'll try it asap.

Thanks
Ian.
Hi Fox,

So I ran Install-Module -Name ExchangeOnlineManagement -RequiredVersion 3.1.0

I tried installing Version 1.0.1 and 2.0.5 and 3.1.0

I tried Global Admin account instead of my admin account.
I tried adding myself to the Exchange Admin role = Organization Management.

Nothing has made any different and I still got the following error.

New-PSSession : [ps.outlook.com] Connecting to remote server ps.outlook.com failed with the following error message :
Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:12
+ $Session = New-PSSession -ConfigurationName Microsoft.Exchange -Conne ...
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
   gTransportException
    + FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed

Any further help greatly appreciated.
Open up powershell as an administrator and try it all again.
Hi Fox,

Nope same Error in Admin mode as well
ASKER CERTIFIED SOLUTION
Avatar of FOX
FOX
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial