$computers = Get-Content computerlist.txt
$scriptblock = {
Get-ChildItem c:\users | Get-ChildItem -filter "documents" |
Get-ChildItem -Recurse -force -ea SilentlyContinue |
Where { !($_.PsIsContainer) } |
Select -expand length |
Measure-Object -Sum |
Select sum
}
Invoke-Command -ComputerName $computers -ScriptBlock $scriptblock | Export-CSV DocumentsSize.csv -notype
http://forums.petri.com/showthread.php?t=43178