Get-MailboxStatistics for an Office 365 mailbox returns MailboxLocation was not found when using GUID for the identity

Hasan Reza 161 Reputation points
2023-04-06T01:27:37.5166667+00:00

Get-MailboxStatistics for an Office 365 mailbox returns MailboxLocation was not found when using GUID for the identity

$variable | % { Get-MailboxStatistics -Identity $_.Exchangeguid | select totalitemsize} response from powershell

MailboxLocation was not found for id "XXXXXXXXXXXXXXXXXXXXXXXXXX".
    + CategoryInfo          : InvalidArgument: (e2c3bbfd-7835-45a3-8780-cb57b90fbd02:GeneralMailboxOrMailUserIdParameter) [Get-MailboxStatistics], MdbAdminTaskException
    + FullyQualifiedErrorId : [Server=AUXP273MB0245,RequestId=adb09c45-1466-4df4-ad93-3e4826f6b704,TimeStamp=4/5/2023 7:58:46 PM] [FailureCategory=Cmdlet-MdbAdminTaskExcept 
   ion] CA110007,Microsoft.Exchange.Management.MapiTasks.GetMailboxStatistics
    + PSComputerName        : outlook.office365.com
 

Regards - Hasan Reza

Exchange Online
Exchange Online
A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.
Exchange | Exchange Server | Other
Exchange | Exchange Server | Other
A robust email, calendaring, and collaboration platform developed by Microsoft, designed for enterprise-level communication and data management.Miscellaneous topics that do not fit into specific categories.
Exchange | Exchange Server | Management
Exchange | Exchange Server | Management
The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yuki Sun-MSFT 41,451 Reputation points Moderator
    2023-04-06T08:00:29.3166667+00:00

    Hi @Hasan Reza

    Could you clarify which GUID you are using? Based on you description, I tried testing in my lab tenant using ExchangeGuid and GUID, both can work properly :
    1

    In order to help narrow down, please double check if you are using the correct Guid value for the script. You can also try manually running the following command using the guid and see if it works:

    Get-MailboxStatistics -Identity <Guid> | select totalitemsize
    

    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.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.