Link to home
Start Free TrialLog in
Avatar of ncomper
ncomper

asked on

Audit My Documents Size on Local machines to plan for Folder Redirecttion

Hi All

We are planning to redirect our users My Documents to a file server, however prior to doing this i would like to know how much data we are going to end up with, is there a script that can go out to each PC and report back the size of the my documents folder, 95% of our estate is Windows 7 so  mostly concerned with this O/S,

Thanks
Avatar of merowinger
merowinger
Flag of Germany image

Check out this article. The guy has the same question.
http://forums.petri.com/showthread.php?t=43178
I haven't tested except on a local machine, but should work.
Using PS Remoting...
$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

Open in new window

Avatar of ncomper
ncomper

ASKER

Thanks, does anything need to be enabled on the remote client machine, it runs on mine OK but not remote PC's (firewall etc is off)

Also is it possible to get the path in export so we know the user?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of footech
footech
Flag of United States of America 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 ncomper

ASKER

Thanks