I am trying to use PowerShell to provide me with the total number of items that a user has in their Inbox. This will help in managing users who are not organising their email system properly. (in the past we have had users with 4000+ emails in their Inbox!
I run this in the Exchange 2010 Management Shell:
Get-Mailbox | Get-MailboxFolderStatistics | Where {$_.Name -match "Inbox"} | Select Identity, Name, ItemsInFolder | Sort-Object ItemsInFolder -descending | Export-csv c:\temp\MailboxItemCountInbox.csv
It looked like it provided what I needed until I looked at the totals. Mine for instance.
The spreadsheet from the above command shows that I have 190 items in my Inbox. I actually have 156!
I understand (from other forums) that this command will also take into account unopened emails.
I have unopened:
66 Deleted
21 drafts
4 Saved Folder
145 Junk Mail
No matter which way I look at these figures i cannot get them to add up to the 190 items reported.
I find this with all the other users.
Am I missing something in the command that will give me an accurate snapshot of the number of items in a users Inbox?
Thanks for your time in viewing this post
Bear in mind that mailbox folders includes calendar and contacts folders.