Forum Discussion
seach-mailbox group mailbox
I have the eDiscovery Administrator role.
Is there a way to batch delete emails from a group mailbox.
I have a testing application that has sent a lot of emails to that group mailbox.
I wish to empty the entire group mailbox.
Whats the best way to do this?
You can use some EWS-based script, or simply recreate the group. Should also be possible to select all messages via Outlook and delete them in one go, but I've only tested this with groups with handful of messages.
- adrianhalidJun 10, 2019Copper Contributor
Is this what you a referring to when you say EWS-based scripts?
https://docs.microsoft.com/en-us/exchange/client-developer/exchange-web-services/explore-the-ews-managed-api-ews-and-web-services-in-exchange
I am currently looking through the documentation trying to figure out how to get the mailbox or folder.
I have tried the select and delete all using the desktop and web client but it doesn't seem to do anything thing when I click delete all.
I can delete in batches on what is displayed on the screen. But it a tedious repetitive process. I would just like a script I can run that deletes all.
- VasilMichevJun 10, 2019MVP
Yup, that's what I'm referring to, and here's an article that talks about using EWS for Groups: https://gsexdev.blogspot.com/2015/05/using-office-365-groups-within-ews.html
You can of course also use the Graph API: https://docs.microsoft.com/en-us/graph/api/group-get-conversation?view=graph-rest-1.0&tabs=cs
- adrianhalidJun 11, 2019Copper Contributor
Thanks.
Just had a look at https://gsexdev.blogspot.com/2015/05/using-office-365-groups-within-ews.html but it seems to be referencing
Microsoft.Exchange.WebServices.Data.Groups.RequestedUnifiedGroupsSet
I have installed the Microsoft Exchange Web Services Managed API 2.2
https://www.microsoft.com/en-us/download/details.aspx?id=42951But can't find that Groups Library.
https://docs.microsoft.com/en-us/dotnet/api/microsoft.exchange.webservices.data?view=exchange-ews-api
I can find in the open source library
https://github.com/OfficeDev/ews-managed-api/tree/master
But I don't think is been implemented in 2.2.
I will continue to read the documentation