Get-MailboxStatistics, Get-Mailbox and Archive Mailboxes (Tricks) Part 2

Check other Parts:

Part 1 : Get-MailboxStatistics, Get-Mailbox and Archive Mailboxes (Tricks) Part 1

Part 3 : Get-MailboxStatistics, Get-Mailbox and Archive Mailboxes (Tricks) Part 3

Now let us look about querying Archives.

First of all, both Get-Mailbox and Get-MailboxStatistics have an -Archive switch parameter. But this is a tricky switch. Back to our pilot user (SoloUser) :

  1. Get-Mailbox SoloUser
  2. Get-Mailbox SoloUser -Archive
  3. Get-MailboxStatistics SoloUser
  4. Get-MailboxStatistics SoloUser -Archive

Archive Mailboxes 1

The first two commands will return exactly the same result, and both will point to the user mailbox not his archive !
Archive Tricks 1While running the third and forth commands, returns different results. Get-MailboxStatistics “User” will point to the user mailbox, while with the -Archive switch, the result will point to the archive mailbox.

a3

 

Note  1:

Let me explain how come Get-Mailbox “User” , and Get-Mailbox “User” -Archive  will return the same result which is the mail user mailbox and not his archive.

The -Archive switch for the (Get-Mailbox) cmd, is meant to be used with -Database , -Server or without any other parameters (Get-Mailbox) .When this happen, the main mailboxes for users who happen to have archives will be returned (not the archives themselves).

So if you type (Get-Mailbox -Archive), then all mailboxes (not the archives) who happen to have archives will be returned.

If you type (Get-Mailbox -Server MBX1 -Archive), then all mailboxes (not the archives) hosted on Server MBX1 who happen to have archives will be returned.

 

Note  2:

Since Get-MialboxStatistics – Archive will retrieve the archive mailbox itself, you cannot use this command to retrieve more than one item at a item.

For example, you cannot say Get-MailboxStatistics -Archive without any additional parameters, or  Get-MailboxStatistics -database  “Test” -Archive,..

The only time you can use  the -Archive switch with the Get-MailboxStatistics command is when you specifically type the identity of the mailbox in question. This is shown the parameter sets of the command

get-archive tricks 3

2 comments on “Get-MailboxStatistics, Get-Mailbox and Archive Mailboxes (Tricks) Part 2

  1. Pingback: Get-MailboxStatistics, Get-Mailbox and Archive Mailboxes (Tricks) Part 3 [Query Archive Mailboxes using PowerShell] | Ammar Hasayen - Blog

  2. Pingback: Get-MailboxStatistics, Get-Mailbox and Archive Mailboxes (Tricks) Part 1 | Ammar Hasayen - Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s