Share via


Exchange 2019 Quick Tip: Change Deleted Item Retention with PowerShell

If you want to change your Deleted Item Retention on your mailbox database, you can do so running a simple command in PowerShell using the Exchange Management Shell:

Set-MailboxDatabase -Identity "Mailbox Database Name" -DeletedItemRetention 30

https://everything-powershell.com/wp-content/uploads/2019/07/db1ret.png

If you wanted to change a single mailbox, then you can run the following command in PowerShell:

Set-Mailbox -Identity "User1" -RetainDeletedItemsFor 30 -UseDatabaseRetentionDefaults $false

https://everything-powershell.com/wp-content/uploads/2019/07/user1retain.png