Report for Total Hard Drive Space Usage
Comments
-
This sounds interesting… So you're saying a report of all used space on all fixed disks on all Windows Workstations? Is that right?
1 -
Yes sir. I found a community shared library script to report the free space, percentage and total disk size.
Feels like a good start (needing subtract free space from the total space to get "used" space).
However, I'm not exactly sure how to get the output of an Atera powershell script. Never done this before but I'm sure someone has or the script would be pretty useless. How are you doing it?
0 -
Might be pointing to the obvious, but there is a KB guide that might be useful for you
https://support.atera.com/hc/en-us/articles/217754428-Run-Powershell-script
let us know if you found how how to get the output log!0 -
Paste this into Powershell:
Get all fixed disks on the local machine$disks = Get-WmiObject -Class Win32_LogicalDisk -Filter "DriveType=3"
Initialize an empty array to store the report$report = @()
foreach ($disk in $disks) {
Display the report in PowerShell
# Create a custom object to store the disk information
$diskInfo = [PSCustomObject]@{
DriveLetter = $disk.DeviceID
VolumeName = $disk.VolumeName
UsedSpaceGB = "{0:N2}" -f (($disk.Size - $disk.FreeSpace) / 1GB)
TotalSpaceGB = "{0:N2}" -f ($disk.Size / 1GB)
FreeSpaceGB = "{0:N2}" -f ($disk.FreeSpace / 1GB)
FreeSpacePct = "{0:N2}" -f (($disk.FreeSpace / $disk.Size) * 100)
}
# Add the disk information to the report array
$report += $diskInfo
}$report | Format-Table -AutoSize
1 -
Hi @tanderson Wow this works well. I can view the output by clicking View or if you miss it you can go to Admin > Users & Security > Audit Log and Recent Processes.
Challenge is that each Device shows as a separate entry and there is no export button or option to see the output short of opening each one at a time.
I guess I just need to figure out how to aggregate the outputs so I don't have to do this for all 200 devices.
1 -
Yes, running this across all Workstations and then aggregating it into a single report would be an excellent next step of improvement. Great job on that @tanderson
0 -
Nice script!
Do you have a fileshare available from all computer so you can pipe the information in a file (e.g. excel?)
Alternatively you can call a webhook from within the script to send the data and then use e.g. PowerAutomate to summarize it in a single file.Both is not a perfect solution but maybe better than viewing all 200 computer ;)
0 -
@tanderson FTW
0 -
We have Egnyte which has an agent mounting a drive letter but those are just the user machines. I'm also trying to backup some industrial PCs that users don't log into.
Maybe if the output gets put into CSV on C:\ for each machine there may be a way to pull all the files from each and dump them in a Sharepoint or something with Power Automate?
0 -
So for anyone interested the Atera chat support guided me to a report called "Audit Report" which contains many things but granular Disk Used space happens to be one of them. For all Agents at All clients. Ended up exporting to Excel and pulling what I needed for a one time thing.
0
Topics
- All Topics
- 42 Getting started
- 26 Read before posting
- 8 Meet and greet
- 257 General
- 71 News and announcements
- 2 Swag
- 1 Roadmap updates
- 83 Resources
- 12 Knowledge Base
- 17 Webinars
- 1 Shared Script Library
- 2 Blog
- 21 Pro Tips
- 28 Got an idea?
- 3 Atera Academy
- 2 ActionAI
- 1 Copilot
- 142 Remote Monitoring and Management
- 85 Remote Monitoring
- 28 Patch Management
- 107 Professional Services Automation
- 65 Helpdesk
- 17 Billing
- 22 Reporting
- 41 Integrations & add-ons
- 22 Integrations
- 11 Add-ons
- 108 Scripting and automations
- 62 Scripts
- 32 Automations