While we assume that when an email is deleted, it is gone forever, things can be different for Microsoft 365 Groups. According to a user, 45+ GBs of deleted emails were not automatically purged or removed. It only increased the mailbox size even though the Inbox included only essential emails. In this post, we will share multiple methods which you or the IT admin can use to purge emails from Deleted items or folders in the Microsoft 365 group.
How to purge emails from Deleted items in Microsoft 365 group
Any IT admin or an account with privileges can use the four methods to purge emails. Here is the list:
- Assign a retention policy
- Use Commandlets
- Use an EWS/Graph API-based script
- Remove messages using OWA
Read about each of them, and use what works best for you.
1] Assign a retention policy
Microsoft 365 offers a retention policy to manage an organization’s data, including the option to retain, delete, or retain and then delete content. According to this Microsoft documentation, it can be configured using the Microsoft Purview compliance portal hub.
- Go to the Microsoft Purview compliance portal.
- Select Data lifecycle management > Microsoft 365 > Retention Policies.
- Select New retention policy to start the Create retention policy configuration, and name it.
- For Decide if you want to retain content, delete it, or both pages, specify the configuration options for retaining and deleting content.
- If you choose the Delete it option, you can remove it after a specific period or delete it immediately.
2] Use Commandlets
If you have access to the mailbox, you can use the ExchangePowerShell command to view deleted items and then hard delete them. However, deleting is not straightforward, and you need to use the New-ComplianceSearch and New-ComplianceSearchAction cmdlets. We suggest that you read about it in detail here.
Once done, you can delete the emails using the following commands
New-ComplianceSearchAction -SearchName "RecoverableItems" -Purge -PurgeType HardDelete
Probably not the best choice, given the number of items you have in the folder, but it will work. This command can delete ten items per run; hence, you will need to add it to the script and run it with elevated privileges.
3] Use an EWS or Graph API-based script to clean up the folder’s content.
You will need to write a script to clean up a folder’s content using the Exchange Web Services (EWS) API or Microsoft Graph API.
When using EWS, It will first have to authenticate your script with the appropriate API and get an access token. Pots that the code will need to use the FindItem method to retrieve a list of the items in the folder and then use the DeleteItem method to delete each item.
When using Graph API, you will need a similar approach. You can use the items endpoint to retrieve the list of items in the folder and the delete button to delete each item.
4] Delete from OWA
if the Group has access to Outlook Web Access or OWA, you can delete the items using the web interface.
- Log in to OWA and open the Group you want to delete messages from.
- Click on the Deleted Items folder in the left panel. This will display a list of all the messages in the Deleted Items folder.
- You can choose to delete an individual or select multiple emails or select all messages, and then click on the Delete button.
- To permanently delete the emails, you must empty the Deleted Items folder. To do this, click the Empty Folder button at the top of the Deleted Items folder.
It would be best if the rendition policy method is used as it will keep working on the background, removing what is unnecessary. Also, the policy can be applied to multiple groups. The rest of the methods will depend on your situation and use case.
Where are 365 group emails stored?
In Microsoft 365, group emails are stored in the group’s mailbox, a special mailbox that all members of the group share. When a group member sends an email to the group, the email is delivered to the group’s mailbox and is visible to all group members. You can access them via Outlook, OWA, Teams app, or the Microsoft 365 admin center.
What is a Microsoft 365 group?
A Microsoft 365 group is a collaborative workspace in the Microsoft 365 suite of applications. It allows users to communicate and collaborate using email, online meetings, file storage, and other tools. The features include group email, shared calendar, file storage, online meetings, mobile apps, and so on.