sirbounty
asked on
Recursive public folder size
I need a bit of help with my code - I want to be able to recursively report the complete size for a public folder and all its child folders.
Here's what I have thus far, but it's currently spitting out results like:
0
0
10
750
0
12
etc...
I'm open to performing this another way, I just want it to match up with what is returned when I right-click on a public folder to get it's size properties...
Here's what I have thus far, but it's currently spitting out results like:
0
0
10
750
0
12
etc...
I'm open to performing this another way, I just want it to match up with what is returned when I right-click on a public folder to get it's size properties...
function Get-PFFolderSizes {
param ($FolderPath)
$Parent = Get-PublicFolder $FolderPath
$Children = Get-PublicFolder $FolderPath -GetChildren
foreach ($child in $Children) {
$size = (Get-PublicFolderStatistics $child -Server $PFServer).totalitemsize.value.tokb()
$ChildSizes += $size
Get-PFFolderSizes $Child.identity.tostring()
}
return $ChildSizes
}
$totalsize = Get-PFFolderSizes $folderpath
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes it is the return of the function is the full size of all the pfs,
ASKER