seach-mailbox group mailbox

Copper Contributor

ow do you search a group mailbox.

Search-Mailbox -Identity "groupbox@mail.com" -SearchQuery 'Subject:"Hello"' -TargetMailbox me@mail.com -TargetFolder "Inbox"

When I try to search the group mailbox I get the error message. The operation couldn't be performed because object 'groupbox@mail.com' couldn't be found on 'xxxxxx.PROD.OUTLOOK.COM'.

But when I search for the mailbox I can find it.

Get-Mailbox -GroupMailbox -Identity "groupbox@mail.com"

Is it because it is a group mailbox? How do you search a group mailbox?

6 Replies

Yup, group mailboxes are not supported. Use eDiscovery/Content search in the Security and compliance center.

@Vasil Michev 

 

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.

@Vasil Michev 

 

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-man...

 

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.

 

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

@Vasil Michev 

 

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=42951

 

But can't find that Groups Library.

 

https://docs.microsoft.com/en-us/dotnet/api/microsoft.exchange.webservices.data?view=exchange-ews-ap...

 

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