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 Server
Exchange Server
A family of Microsoft client/server messaging and collaboration software.
1,370 questions
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,631 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,708 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,681 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yuki Sun-MSFT 41,171 Reputation points Microsoft Vendor
    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 Answers by the question author, which helps users to know the answer solved the author's problem.