Home / Server / Windows Server / How to Check Disk Space on Windows Server

How to Check Disk Space on Windows Server

Running out of disk space on a server causes services to stop, logs to fail, and databases to crash — often without much warning. Regularly checking disk space and knowing where space is being consumed lets you act before it becomes an outage. Here is how to check disk space on Windows Server.

Check Disk Space in File Explorer

The quickest visual check: open File Explorer → This PC. Each volume shows its used and free space as a bar. Right-click any drive and select Properties for exact figures in GB.

Check Disk Space with PowerShell

For a clean report on all drives — useful for scripting and remote checks:

Get-PSDrive -PSProvider FileSystem | Select-Object Name, @{N='Used(GB)';E={[math]::Round($_.Used/1GB,2)}}, @{N='Free(GB)';E={[math]::Round($_.Free/1GB,2)}}, @{N='Total(GB)';E={[math]::Round(($_.Used+$_.Free)/1GB,2)}}

This outputs a table with used, free, and total space for every drive letter. Run it from a remote PowerShell session to check a server without logging in directly.

Check Disk Space with WMIC (Command Prompt)

wmic logicaldisk get caption,size,freespace

Returns raw bytes — divide by 1,073,741,824 to convert to GB. Less readable than PowerShell but available in any CMD window.

Find What Is Using the Space

Knowing a drive is 95% full is only the starting point. Finding what is consuming it:

Windows Disk Cleanup

Right-click the drive → Properties → Disk Cleanup. On a server, this is limited but will identify temporary files and Windows Update cleanup candidates. Click Clean up system files for a more comprehensive scan including old Windows versions and update caches.

WinDirStat or TreeSize Free

Install WinDirStat or TreeSize Free on the server for a graphical breakdown of which folders and files are taking the most space. Both are free and safe to install on a server. WinDirStat shows a colour-coded block map — large blocks indicate large files or folders worth investigating.

PowerShell — Find Large Folders

To identify the largest top-level folders on C: without installing software:

Get-ChildItem C:\ -Directory | ForEach-Object {
    $size = (Get-ChildItem $_.FullName -Recurse -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum).Sum
    [PSCustomObject]@{Folder=$_.FullName; Size_GB=[math]::Round($size/1GB,2)}
} | Sort-Object Size_GB -Descending | Select-Object -First 10

This lists the top 10 largest folders at the root of C: by size in GB.

Common Space Consumers on Windows Server

  • C:\Windows\WinSxS — component store, grows over time. Run Dism /Online /Cleanup-Image /StartComponentCleanup to reduce it.
  • C:\Windows\SoftwareDistribution\Download — Windows Update downloads. Safe to clear after updates are installed: stop Windows Update service, delete contents, restart the service.
  • C:\inetpub\logs — IIS logs if the server runs a web server. These grow indefinitely unless rotation is configured. Check and archive or delete old log files.
  • Event log files — in C:\Windows\System32\winevt\Logs\. Check maximum log sizes in Event Viewer → right-click each log → Properties.
  • Database files — SQL Server, Exchange, or other databases. Growth here is expected but should be monitored.
  • User profiles and redirected folders — if the server hosts user profiles, these accumulate quickly. Check C:\Users\ and review large profiles.

Setting Up a Disk Space Alert

Rather than checking manually, set up an alert before a drive fills up. In Windows Server, use the File Server Resource Manager (FSRM) role to configure threshold-based email alerts. Alternatively, most monitoring tools (PRTG, Zabbix, Checkmk, Nagios) include disk space sensors that alert when free space falls below a set percentage.

A simple PowerShell script in Task Scheduler can also send an email alert:

$drives = Get-PSDrive -PSProvider FileSystem
foreach ($drive in $drives) {
    $pct = [math]::Round(($drive.Free / ($drive.Used + $drive.Free)) * 100, 1)
    if ($pct -lt 15) {
        Send-MailMessage -To "[email protected]" -From "[email protected]" -Subject "Low disk space on $($drive.Name):" -Body "Free: $pct%" -SmtpServer "mail.example.com"
    }
}

Sign Up For Daily Newsletter

Stay updated with our weekly newsletter. Subscribe now to never miss an update!

[mc4wp_form]

Leave a Reply

Your email address will not be published. Required fields are marked *