asked on
I have a script that will pull info for 1 mailbox. I need it for ALL mailboxes:
$mailbox1=get-mailbox mailbox1Get-MailboxFolderStatistics $mailbox1 | ? {$_.folderpath -like "*inbox/*" -and $_.date -gt (Get-Date).AddDays(-2) } | select $Mailbox1.name,folderpath
or
$All = Get-Mailbox -ResultSize Unlimited
$All | foreach {Get-MailboxFolderStatistics -Identity $_.Identity -FolderScope Inbox | Format-Table Identity,ItemsInFolderAndSubfolders,FolderAndSubfolderSize -AutoSize}
Refer: office-docs-powershell/Get-MailboxFolderStatistics.md at master · MicrosoftDocs/office-docs-powershell · GitHub