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.  
13 years ago
 
 

 
 Posts
Posts
 
