Trying to get this script to run:
$pf=Get-PublicFolder \ -Recurse -ResultSize unlimited;foreach ($i in $pf) {$s=Get-PublicFolderItemStatistics $i.EntryID;foreach ($r in $s) {if ($r -gt "38600") {$r.MessageSize,$r.PublicFolderName}}}
But I get this error:
Cannot compare "Microsoft.Exchange.Data.Storage.Management.PublicFolderItemStatistics" to "38600" because the objects are not the same type or the object
"Microsoft.Exchange.Data.Storage.Management.PublicFolderItemStatistics" does not implement "IComparable".
At line:1 char:145
+ ... mStatistics $i.EntryID;foreach ($r in $s) {if ($r -gt "38600") {$r.Me ...
+ ~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], ExtendedTypeSystemException
+ FullyQualifiedErrorId : PSObjectCompareTo
Cannot compare "Microsoft.Exchange.Data.Storage.Management.PublicFolderItemStatistics" to "38600" because the objects are not the same type or the object
"Microsoft.Exchange.Data.Storage.Management.PublicFolderItemStatistics" does not implement "IComparable".
Any ideas as I can't figure out the error, unless I need to run some other variant?