Forum Discussion
Delete items from Recoverable Items folder
- May 06, 2018Hi, To use the DeleteContent switch with Search-Mailbox cmdlet, you have to be assigned the Mailbox Import Export management role. By default, this role isn't assigned to any role group. Typically, you assign a role to a built-in role group, or you can assign a role to a user, or a universal security group. The below example add the role to the Organization Management role group: New-ManagementRoleAssignment -Name "Import_Export_Organization_Management" -SecurityGroup "Organization Management" -Role "Mailbox Import Export" Note: You have to create a new Exchange Online PowerShell session to get new role permissions. 
is it that search mailbox doesnot work for exchange online, i have rights to mailbox search and importexport
[PS] C:\Windows\system32> Search-Mailbox myuser -SearchQuery size>0 -SearchDumpsterOnly -DeleteContent
Search-Mailbox : The term 'Search-Mailbox' is not recognized as the name of a cmdlet, function, script file, oroperable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:2
+ Search-Mailbox myuser -SearchQuery size>0 -SearchDumpsterOnly -DeleteContent
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Search-Mailbox:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException