Hi @George Victor ,
Did you mean that you would like to locate mailboxes not hosted on the mail server you are working on?
If in this case, you could run below command to check it.
Get-Remotemailbox “mailboxname” | FL LegacyExchangeDN
Here’s a document for you reference.
https://www.petenetlive.com/KB/Article/0001468
Please Note: Since the web sites are not hosted by Microsoft, the links may change without notice. Microsoft does not guarantee the accuracy of this information.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.