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

    Question

  • If I run the Get-MailboxStatistics cmdlet for an Office 365 mailbox and I use a UPN for the identity (e.g. Get-MailboxStatistics -Identity <UPN>) it works fine.

    However, if I use the GUID instead of the UPN (e.g. Get-MailboxStatistics -Identity efc9490f-345b-4944-a391-06138fe746d9) I get the following:

         MailboxLocation was not found for id "James Martin".

    It obviously translates the GUID to the correct user because the error message returns the user name instead of the GUID.

    This appears to be something relatively new because this used to work.

    Thanks,

    -Paul

    Tuesday, January 3, 2017 8:52 PM

Answers

All replies

  • Hi Paul,

    I tested the Get-MailboxStatistics cmdlet with GUID for an Office 365 mailbox and there is no issue for it:

    Based on your error description "MailboxLocation was not found for id "James Martin"", please run the following command to check your mailbox information:

    Get-Mailbox "James Martin" | fl *GUID*,*Recipient*,*location*

    If possible, please share the command results here for further analysis.

    By the way, this forum focuses on some general discussion about Office 365 ProPlus which is the version of Office that comes with many Office 365 plans. If you have any further question about Exchange Mailbox, I suggest we can post the issue in Microsoft Exchange Online (Office 365) forum for more professional suggestions :)
    http://social.technet.microsoft.com/Forums/en-US/home?forum=onlineservicesexchange


    Regards,

    Winnie Liang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, January 4, 2017 7:43 AM
    Moderator
  • Thanks for the reply. The output is below. I did notice that I have a property called MailboxLocations (plural)

    Get-Mailbox -identity "James Martin" | fl *GUID*,*Recipient*,*location*


    ExchangeGuid             : 78596136-f786-4930-86a5-52a74bf9b0fd
    MailboxContainerGuid     : 
    AggregatedMailboxGuids   : {}
    ArchiveGuid              : 00000000-0000-0000-0000-000000000000
    DisabledArchiveGuid      : 00000000-0000-0000-0000-000000000000
    Guid                     : 04730615-b2b2-47f6-87a0-1a54ba1b9cb0
    RecipientLimits          : 500
    RemoteRecipientType      : None
    RecipientType            : UserMailbox
    RecipientTypeDetails     : UserMailbox
    MailboxLocations         : {1;78596136-f786-4930-86a5-52a74bf9b0fd;Primary;namprd08.prod.outlook.com;ec3f249e-17d5-4018-8621-a062db8c9d47}
    DisabledMailboxLocations : False
    UsageLocation            : United States


    Wednesday, January 4, 2017 12:48 PM
  • Hi Paul,

    Based on the command results, the MailboxLocations seems to be proper for this mailbox.

    To do further troubleshooting, please run the following command in your Windows PowerShell connected to Exchange Online:

    Get-MailboxStatistics -Identity 04730615-b2b2-47f6-87a0-1a54ba1b9cb0

    Get-MailboxStatistics -Identity 78596136-f786-4930-86a5-52a74bf9b0fd

    Get-MailboxLocation -User "James Martin"


    Regards,

    Winnie Liang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, January 5, 2017 4:49 AM
    Moderator
  • Those commands work fine (see output down below). What I was doing was using the ObjectId of the user who was associated with the mailbox:

    get-msoluser -searchstring "james martin" | fl objectid

       ObjectId : efc9490f-345b-4944-a391-06138fe746d3

    I can then use that ObjectId in other mailbox cmdlets like Get-Mailbox, Get-MailboxPermission and Get-MailboxLocation

    get-mailbox -identity efc9490f-345b-4944-a391-06138fe746d3

       Name                      Alias                ServerName       ProhibitSendQuota
       ----                      -----                ----------       -----------------
       James Martin              jmartin              mwhpr08mb2991    49.5 GB (53,150,220,288 bytes)

    get-mailboxpermission -identity efc9490f-345b-4944-a391-06138fe746d3

       Identity             User                 AccessRights                 IsInherited Deny
       --------             ----                 ------------                 ----------- ----
       James Martin         NT AUTHORITY\SELF    {FullAccess, ReadPermission} False       False
       James Martin         NAMPRD08\Administ... {FullAccess}
       ...

    get-mailboxlocation -user efc9490f-345b-4944-a391-06138fe746d3

       RunspaceId                    : cea9e3c1-eede-4f6a-844b-cdee98467174
       MailboxGuid                   : 78596136-f786-4930-86a5-52a74bf9b0fd
       ...

    But it does NOT work for Get-MailboxStatistics - this used to work but something appears to have changed. If this is going to be the case going forward I will change my code but it would be nice to know why the cmdlets above work but Get-MailboxStatistics does not.

    PS C:\Users\administrator.DRDOM801> get-mailboxstatistics -identity efc9490f-345b-4944-a391-06138fe746d3
    MailboxLocation was not found for id "James Martin".
        + CategoryInfo          : InvalidArgument: (efc9490f-345b-4944-a391-06138fe746d3:GeneralMailboxOrMailUserIdParameter) [Get-MailboxStatistics], MdbAdminTaskException
        + FullyQualifiedErrorId : [Server=CY1PR0801MB2155,RequestId=9186e4b1-1612-4f03-917c-e3902f852c07,TimeStamp=1/5/2017 1:54:37 PM] [FailureCategory=Cmdlet-MdbAdminTaskException] 7BDAC52E,M 
       icrosoft.Exchange.Management.MapiTasks.GetMailboxStatistics
        + PSComputerName        : outlook.office365.com

    --------------------------------------------------------------------------------------------------------------

    Get-MailboxStatistics -Identity 04730615-b2b2-47f6-87a0-1a54ba1b9cb0

       DisplayName               ItemCount    StorageLimitStatus LastLogonTime
       -----------               ---------    ------------------ -------------
       James Martin              191                             1/3/2017 11:17:58 AM

    Get-MailboxStatistics -Identity 78596136-f786-4930-86a5-52a74bf9b0fd

       DisplayName               ItemCount    StorageLimitStatus LastLogonTime
       -----------               ---------    ------------------ -------------
       James Martin              191                             1/3/2017 11:17:58 AM

    Get-MailboxLocation -User "James Martin"

       RunspaceId                    : cea9e3c1-eede-4f6a-844b-cdee98467174
       MailboxGuid                   : 78596136-f786-4930-86a5-52a74bf9b0fd
       ...

    Thanks,

    -Paul

    Thursday, January 5, 2017 2:36 PM
  • Hi Paul,

    If using the ObjectID as the Identity in my test environment, I get the same results as yours with Get-MailboxStatistics cmdlet.

    Reading more reference about the "Identity" parameter for these commands, the ObjectID is not listed as the Identity of Get-MailboxStatistics cmdlet. Please read:

    https://technet.microsoft.com/en-us/library/bb124612(v=exchg.160).aspx#Parameters

    As for the Get-MailboxPermission cmdlet, the ADObjectID is listed under the Identity parameter:https://technet.microsoft.com/en-us/library/aa998218(v=exchg.160).aspx#Parameters

    In your scenario, please use the GUID instead of ObjectID for the Get-MailboxStatistics cmdlet :)


    Regards,

    Winnie Liang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Proposed as answer by Allen_WangJF Friday, January 6, 2017 5:49 AM
    • Marked as answer by paulj2 Tuesday, January 10, 2017 2:00 AM
    Friday, January 6, 2017 5:25 AM
    Moderator
  • Hi,

    Any updates on the issue? Please feel free to let me know if you need any further assistance :)


    Regards,

    Winnie Liang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, January 10, 2017 1:58 AM
    Moderator