We help IT Professionals succeed at work.

Hoist the colors! We’ve added location flags to usernames sitewide, so it's easier to connect with the global community on EE. View My Profile

x

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

1,048 Views
Last Modified: 2014-05-12
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
Comment
Watch Question

Check out this article. The guy has the same question.
http://forums.petri.com/showthread.php?t=43178
CERTIFIED EXPERT
Top Expert 2014

Commented:
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

Author

Commented:
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
CERTIFIED EXPERT
Top Expert 2014
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.