As a follow on from my previous post we can do some neat calculations on the amount of data stored in MOSS personal sites using Powershell.
Using the measure-object CmdLet against the StorageUsedMB property we can calculate the number of personal sites (+1 one as it includes the root site), average size of of each site, smallest, largest and total storage size of all sites.
Again assuming http://sps:20488 is where your personal sites are hosted
PoSH C:\demo> $output=stsadm -o enumsites -url "http://sps:20488"PoSH C:\demo> $xml=[XML]$outputPoSH C:\demo> $xml.sites.site | measure-object storageusedmb -min -max -sum -average | format-tableCount Average Sum Maximum Minimum Property ----- ------- --- ------- ------- -------- 5 0.62 3.1 0.7 0.4 StorageUs...
To get a list of the sites in question with the largest at the top use -descending on the sort CmdLet:
PoSH C:\demo> $xml.sites.site | sort storageusedmb -descending | select url, owner, storageusedMB | format-tableUrl Owner StorageUsedMB --- ----- ------------- http://sps:20488/person... CONTOSO\mike 0.7 http://sps:20488/person... CONTOSO\jeff 0.7 http://sps:20488/person... CONTOSO\administrator 0.7 http://sps:20488 CONTOSO\administrator 0.6 http://sps:20488/person... CONTOSO\brianb 0.4
And if you just want the top 2 offenders us the -first option on the select-object CmdLet
PoSH C:\demo> $xml.sites.site | sort storageusedmb -descending | select url, owner, storageusedMB -first 2 | format-tableUrl Owner StorageUsedMB --- ----- ------------- http://sps:20488/person... CONTOSO\mike 0.7 http://sps:20488/person... CONTOSO\jeff 0.7
Obviously in real life those figures would be a lot larger!< P>
Powered by: newtelligence dasBlog 2.0.7226.0
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2008, Colin Byrne
E-mail