Find the 20 Largest Files on Windows
Lists the 20 largest files under C:\Users with path and size. Use it to find why a disk is full.
- Windows18
- macOS5
- Linux5
- Network3
- Disk and storage4
- Inventory4
- Security9
- Updates4
- Maintenance4
Script
Get-ChildItem 'C:\Users' -Recurse -File -Force -ErrorAction SilentlyContinue |
Sort-Object Length -Descending |
Select-Object -First 20 @{ Name = 'SizeMB'; Expression = { [math]::Round($_.Length / 1MB, 1) } }, FullName |
Format-Table -AutoSize | Out-String -Width 300Run it on every device with Moftgate
- 01
Add the script
In the Moftgate console, open Scripts > New script and paste the code.
- 02
Select the OS
Select Windows as the target operating system.
- 03
Test it
Run it on one test device first and read the output.
- 04
Roll out
Send it to all targets by group, profile or tag. Each device result is recorded separately.
These may help too
Windows Disk Space Report
Lists size, free space and free percent for all local disks. Flags disks below 10% free.
Windows · PowerShellClean Up Temporary Files on Windows
Deletes files older than 7 days in the Windows Temp folder and every user's Temp folder. Reports the space recovered.
Windows · PowerShellClear the DNS Cache on Windows
Empties the DNS client cache. Use it when a site resolves to the wrong IP or a DNS record has just changed.
Manage scripts from one console
Target selection, a confirmation step, per-device output and an audit log. The first 200 endpoints are free for a year.