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

Check other Parts :

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

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

Observation : I will start by creating an empty database (Test), and then i will run both Get-Mailbox and Get-MailboxStatistics on it.

Running Get-Mailbox, returns nothing, while running Get-MailboxStatistics returns the System Mailbox

 

Get-Mailbox Tricks

Observation : I will create user called (SoloUser) and create for him a mailbox on (Test) database

Running Get-Mailbox will return the SoloUser mailbox, while running Get-MailboxStatistics will not return the SoloUser mailbox until his first logon !

Rule : Get-MailboxStatistics only retrieves mailboxes ONLY after the first logon

Get-Mailbox Tricks 2

After the successful logon for SoloUser, running the Get-MailboxStatistics will return the system mailbox and the user mailbox.

Get-Mailbox Tricks 3

 

Observation : Now we will enable archive for that user, and run both commands:

Get-Mailbox will only return the SoloUser, while Get-MailboxStatistics will return the mailbox and archive beside the system mailbox

Get-Mailbox Tricks 2

Get-Mailbox Tricks 4 

Observation : Now i will create a user with archive called (FiredUser) on the Test database, and then i will disable his archive.

– Running Get-MailboxStatistics “FiredUser” -Archive >> Error no Archive for this user

-Running Get-MailboxStatistics -database “Test”  >> Will show the archive mailbox for FiredUser with full properties and no indication or any property that it is deleted

Get-Mailbox Tricks 6

The strange thing is that FiredUser has his archive deleted (disabled) and yet his archive is showing when running Get-MailboxStatistics for the Test database. When viewing the full properties of that personal archive, nothing indicates it was deleted

Get-Mailbox Tricks 7

Rule : Get-MailboxStatistics will always return everything if the lastlogonstamp is there, even if the item is marked for deletion.

 

Observation : Finally, i will move the SoloUser mailbox and its archive to another database. Get-Mailbox will not return anything, while Get-MailboxStatistics will return everything.

Get-MailboxStatistics 14

 

Conclusion :

Get-Mailbox will only return the active live user mailboxes (not archive mailboxes). If the user is moved to another database or deleted, this command will not show deleted mailboxes or the soft deleted mailboxes in case of a local move request

Get-MailboxStatistics will return the system mailbox + user mailbox + archive mailbox + deleted mailboxes (mark for deletion) + softly deleted mailboxes (in case of local move request)

Get-MailboxStatistics 15

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

  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 2 | 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