Loads of posts on this topic but none of them pertain to Office 365. They all suggest solutions like add yourself to the correct role etc. but that only applies to Exchange on-prem. Coz this cmdlet is only present on-prem. It even says so on the cmdlet help page.
For the cloud use Purview. Be sure to use Edge, that’s all. You can define the search criteria as per this document.