Thursday 7 June 2012

EX2010: ItemCount in a Public Folder

I needed to count the number of items in a bunch of subfolders in a Public Folder.  Here's how:

Get-PublicFolder
-id "\Storage\02_FeedbackArchive\"
-Recurse
-ResultSize unlimited
| Get-PublicFolderStatistics
| ft Name,ItemCount,Folderpath
> c:\powershell\ps_output\pf_itemcount_7jun12.txt

Get-PublicFolder -id "\Admin\02_Archive\00_Done\EmailFeedbackReport" -Recurse -ResultSize unlimited | Get-PublicFolderStatistics | ft Name,ItemCount,Folderpath > c:\powershell\ps_output\pf_itemcount_7jun12.txt

... This command took four minutes to run to produce a 111K .txt file, counting the items of 68 subfolders.  

No comments:

Post a Comment