Hi, @Geezer32
Even if shared mailboxes do not have licenses, they can have retention policies set up in the Security and Compliance Center. However, shared mailboxes without a license are limited in storage capacity to a maximum of 50 GB. For basic retention policies, you may be able to use the Security and Compliance Center without an E5 license.
You can use the Power Shell for assigning retention policies to mailboxes, which is divided into the following three steps:
1.Create customized retention tags.
You can create a customized retention tag with the following command:
New-RetentionPolicyTag -Name "OneWeekDelete" -Type Inbox -RetentionEnabled $true -AgeLimitForRetention 7 -RetentionAction DeleteAndAllowRecovery
2.Create a retention policy and add retention tags
You can create a customized retention policy using the following commands and add the retention tags created above to it:
New-RetentionPolicy -Name "OneWeekDeletePolicy" -RetentionPolicyTagLinks "OneWeekDelete"
3.Assign the retention policy to shared mailboxes
You can use the following command to assign the retention policy to the corresponding shared mailbox to retain emails for 7 days and then delete them:
Set-Mailbox -Identity "******@domain.com" -RetentionPolicy "OneWeekDeletePolicy"
4.Finally, use the following command to see if the retention policy was successfully applied to the shared mailbox.
Get-Mailbox -Identity "******@domain.com"|Select-Object RetentionPolicy
More information can be found Create a Retention Policy in Exchange Online | Microsoft Learn
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".