Link to home
Start Free TrialLog in
Avatar of leop1212
leop1212Flag for United States of America

asked on

Exchange 2010 powershell public folder size statistic to Excel file

I am looking for a powershell command syntax to get a list of public folder statistics into excel sorted by folder size.
i found this syntax
its only reporting 100 top items and suggests adding a parameter "-ResultSize Unlimited" for all folders.
1. I am not sure where to add unlimited.
2. I'd like size reported in megabites if possible and

$script:CSV = @()
 
function AddCSV([string]$sName,[string]$sSize)
{
      $logentry = new-Object -typename System.Object
      $logentry | add-Member -memberType noteProperty -name Name -Value $sName
      $logentry | add-Member -memberType noteProperty -name Size -Value $sSize
      $script:CSV += $logentry
}
 
foreach ( $pubflr in Get-PublicFolderStatistics -Server "server>")
{
AddCSV $pubflr.AdminDisplayName $pubflr.TotalItemSize
}  
 
$CSV | export-csv -Path "g:\PubFlrs.log"
ASKER CERTIFIED SOLUTION
Avatar of Raheman M. Abdul
Raheman M. Abdul
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of leop1212

ASKER

your code produced more records  but wrong results.
original cacl in pubflrs1 is in line with data while new output is wrong on numbers pubflrs
see attached.
PubFlrs1.log
PubFlrs.log