Check other Parts:
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) :
- Get-Mailbox SoloUser
- Get-Mailbox SoloUser -Archive
- Get-MailboxStatistics SoloUser
- Get-MailboxStatistics SoloUser -Archive
The first two commands will return exactly the same result, and both will point to the user mailbox not his archive !
While 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.
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.
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