I am wanting to send a daily report to our managers that will let them know how many emails are in someones inbox. The script I have so far is below. The problem is Get-MailboxFolderStatistics also reports hidden items in that folder. So it is not a realistic number of emails in their inbox. Does anyone have an idea on how to list only the emails and not the hidden content?
My thought was have it list only the email between the OldestItemReceivedDate and NewestItemReceivedDate but I haven’t figured out how to make that work yet. I also looked into using the Mailboxsearch but couldn’t figure out how to make it search only the users’ inboxes and provide a count only.
I don’t understand what is hidden in the inbox or inbox and subfolders?
when you return results for just those foldernames it should be showing the correct count
Outlook on the other hand may be doing some kind of filtering not showing the messages. But that would be totally client side.