Hi there,
It’s a good idea to replace older calls to the Get-Mailbox cmdlet with Get-ExoMailbox. However, it’s not just a matter of cut and paste updates. In some cases, the nature of the new REST-based cmdlets mean that some additional care is necessary to ensure that the updated code works as expected.
You can get more info from here https://techcommunity.microsoft.com/t5/exchange/using-filters-with-the-get-exomailbox-cmdlet/m-p/2466152
Hope this resolves your Query!!
--If the reply is helpful, please Upvote and Accept it as an answer--