I need to list all folders that our users have in their outlook inc number of items.
This is what I have:
Get-Mailbox | Get-MailboxFolderStatistics -FolderScope All |Sort-Object FolderSize -Descending|Where-Object{$_.FolderPath -notlike"/RSS Feeds*"-and$_.FolderPath -notlike"/Sync Issues*"-and$_.FolderPath -notlike"/Journal"-and$_.FolderPath -notlike"/Purges"-and$_.FolderPath -notlike"/Versions"-and$_.FolderPath -notlike"/News Feed"-and$_.FolderPath -notlike"/Contacts"-and$_.FolderPath -notlike"/Suggested Contacts"-and$_.FolderPath -notlike"/Conversation Action Settings"-and$_.FolderPath -notlike"/Quick Step Settings"-and$_.FolderPath -notlike"/Top of Information Store"}|select-object Identity,FolderSize,ItemsInFolder |Export-Csv c:\users\<usr>\folders.csv |
But I can't get it to display the username in it's seperate column so everyones inbox is showing first, instead of it being sorted by user :(