none
How to find which mailbox is the primary mailbox of one specific archive mailbox in Exchange 2013 via PowerShell? RRS feed

  • Question

  • How to find which mailbox is the primary mailbox of one specific archive mailbox in Exchange 2013 via PowerShell?

    In Exchange 2013, using Get-MailboxStatistics cmdlet against one mailbox database, I can get a list of mailboxes, including archive mailboxes, in that mailbox database. Base on this list, how can I get its primary mailbox of each archive mailbox? Thanks!

    Sunday, November 18, 2012 6:20 AM

Answers

  • How to find which mailbox is the primary mailbox of one specific archive mailbox in Exchange 2013 via PowerShell

    Hi,
    This will give you the list of all Archive Mailboxes in database DB01 and where the primary mailbox is stored.

    Get-Mailbox -Archive -Database DB01 | ft Name,Database,ArchiveName,Archivedatabase



    Martina Miskovic


    Saturday, November 24, 2012 4:45 AM

All replies

  • Hello,

    By default, the display name for archive mailbox is like this "Personal Archive –primary mailbox name", so you can get its primary mailbox of each archive mailbox from the display name.

    Get-mailboxStatics -Database "Mailbox Database"|fl DisplayName

    If you didn't use the default display name for archive mailbox, you can use this command to help you find the primary mailbox:

    Get-mailbox| where{ $_.ArchiveName -like  'Your Archive mailbox's DisplayName'}

    Thanks,

    Evan Liu

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tnmff@microsoft.com


    Evan Liu

    TechNet Community Support


    Monday, November 19, 2012 9:35 AM
    Moderator
  • Thanks Evan! Yes, it works.

    But there has one scenario, if each user mailbox has one associated archive mailbox and I only have a list of all archive mailboxes, to find each primary mailbox for each archive mailbox, the time complexity of your solution will be O(n^2). The solutoin what I want to find is O(1), just like from primary mailbox to find associated archive mailbox the time complexity is O(1). Is there has such similar cmdlet, from archive mailbox to find primary mailbox, in Exchange Server 2013?

    Tuesday, November 20, 2012 11:11 AM
  • Hello,

    You can follow this way to list all the primary mailbox name and archive mailbox name:

    $MailboxGuids=(Get-MailboxStatistics -Database "Archive mailbox Database").MailboxGuid
    
    Foreach($MailboxGuid in $MailboxGuids){
    
    Get-Mailbox| where{$_.ArchiveGuid -eq $MailboxGuid}|fl DisplayName, ArchiveName

    In this script, it will return all the primary mailbox name and archive mailbox name for all the archive mailboxes on that archive mailbox database.

    Thanks,

    Evan Liu

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contacttnmff@microsoft.com


    Evan Liu

    TechNet Community Support

    Wednesday, November 21, 2012 6:32 AM
    Moderator
  • How to find which mailbox is the primary mailbox of one specific archive mailbox in Exchange 2013 via PowerShell

    Hi,
    This will give you the list of all Archive Mailboxes in database DB01 and where the primary mailbox is stored.

    Get-Mailbox -Archive -Database DB01 | ft Name,Database,ArchiveName,Archivedatabase



    Martina Miskovic


    Saturday, November 24, 2012 4:45 AM