get-mailboxfolderstatistics myusername | where {$_.name -match "Inbox|Deleted|Sent|Calendar|Drafts"} | sort-object Name | ft Name, FolderPath, ItemsInFolder, FolderSize -auto
Powershell get-mailboxfolderstatistics multiple folders
-
14-06-2023 - |
سؤال
I have this script. Looking to include, deleted items, sent items and drafts in the output.
Whats the best way to include that?
Thanks
Get-MailboxFolderStatistics myuserename -FolderScope Inbox | Where {$_.FolderPath -eq "/Inbox"}
المحلول 2
نصائح أخرى
The easiest way I know of is to filter multiple folders at once is to use -match and a regex alternation:
Get-MailboxFolderStatistics myuserename |
Where {$_.FolderPath -match '/Inbox|/Deleted Items|/Sent Items|/Drafts'}
لا تنتمي إلى StackOverflow