Deleted Item Retention (duration for which the items deleted from ‘Deleted Items’ folder in your Outlook are kept in the Dumpster) is set to 14 days by default and can be changed.
To change this setting, we need to modify RetainDeletedItemsFor (how many days the items are retained in Dumpster) and UseDatabaseRetentionDefaults (clear the checkbox ‘Use Mailbox Database Defaults’) properties.
Set-Mailbox “UserName” -RetainDeletedItemsFor 30.00:00:00 -UseDatabaseRetentionDefaults $false
Set-Mailbox “John Doe” -RetainDeletedItemsFor 00:00:00 -UseDatabaseRetentionDefaults $false
Note: The excellent idea of changing DeletedItemFlags property from DatabaseDefault to RetainForCustomPeriod doesn’t work as the DeletedItemFlags is a calculated property and, thus, can’t be changed.