How to Determine the Minimum Staging Area DFSR Needs for a Replicated Folder
How do you find these X largest files? With PowerShell
Use a PowerShell script to find the 32 or 9 largest files and determine how many gigabytes they add up to. I am actually going to present you with three PowerShell scripts. Each is useful on its own; however, number 3 is the most useful.
1. Run:
Get-ChildItem c:\temp -recurse | Sort-Object length -descending | select-object -first 32 | ft name,length -wrap –auto
This command will return the file names and the size of the files in bytes. Useful if you want to know what 32 files are the largest in the Replicated Folder so you can “visit” their owners.
2. Run:
Get-ChildItem c:\temp -recurse | Sort-Object length -descending | select-object -first 32 | measure-object -property length –sum
This command will return the total number of bytes of the 32 largest files in the folder without listing the file names.
3. Run:
$big32 = $foo = Get-ChildItem c:\temp -recurse | Sort-Object length -descending | select-object -first 32 | measure-object -property length –sum
$big32.sum /1gb
This command will get the total number of bytes of 32 largest files in the folder and do the math to convert bytes to gigabytes for you. This command is two separate lines. You can paste both them into the PowerShell command shell at once or run them back to back.
Categorised as: Microsoft, Networking, Server OS
Leave a Reply
You must be logged in to post a comment.