Exchange Online - delete a message in a mailbox with command powershell

dgswin
dgswin used Ask the Experts™
on
With Exchange Online, with command powershell:
Search-Mailbox -Identity "April Stewart" -SearchQuery 'Subject:"Your bank statement"' -DeleteContent

This message appears:
A parameter cannot be found that matches parameter name 'DeleteContent'

How I can delete a message in a mailbox with a subeject for the mailbox in Exchange Online?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
You need permissions for that, namely you need to be assigned the "Mailbox Import Export" role.

Author

Commented:
Where can i add this role?
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
In the Exchange admin center.
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

Author

Commented:
I don't have this choice, see the attach file
ExchangeAdminRole.jpg
Most Valuable Expert 2015
Distinguished Expert 2018
Commented:
It's a ROLE, not role group. If you want to use a role group, Compliance management or Discovery management would do.

Author

Commented:
Thank you!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial