Windows Server Disk Space: Remove Disabled Roles & Features Payload Files

Windows Server ships with the payload files for every optional Feature and Role pre-staged locally, so installing them later doesn’t require internet access or separate media — convenient, but it also means those payload files sit on your system drive taking up space whether you ever use the feature or not. Reclaiming the Space From […]

Remove Windows Server Disabled Roles And Features Payload Files
Windows Server ships with the payload files for every optional Feature and Role pre-staged locally, so installing them later doesn’t require internet access or separate media — convenient, but it also means those payload files sit on your system drive taking up space whether you ever use the feature or not.

Reclaiming the Space

From an elevated PowerShell prompt on the server, run:
Get-WindowsOptionalFeature -Online | Where-Object { $_.State -match "Disabled" } |
ForEach-Object {
    DISM /Online /Disable-Feature /FeatureName:$_.FeatureName /Remove
}
This finds every feature currently in a Disabled state and runs DISM against each one with the /Remove switch, which strips out the locally-staged payload files for features you’re not using. You should typically see somewhere in the region of 1–2GB freed up, though the exact figure depends on which roles and features are present on that particular server build.

Important Caveat

Once removed, re-enabling that feature later will require either internet access (Windows will fetch the payload from Windows Update) or pointing DISM at installation media with the /Source switch — it won’t be a quick local re-enable anymore. Don’t run this against features you might need to toggle on and off regularly.

Still the Right Approach on Current Windows Server (Updated for 2026)

This DISM-based cleanup works unchanged on Windows Server 2025, still the current LTSC release. One thing worth adding to the script above: pipe the results to a log file first before removing anything, since Get-WindowsOptionalFeature -Online can occasionally list features under names you didn’t expect (naming has shifted slightly between some builds). A quick dry run first — Get-WindowsOptionalFeature -Online | Where-Object { $_.State -match "Disabled" } | Select FeatureName | Out-File C:\Temp\DisabledFeatures.txt — lets you sanity-check the list before running the actual removal loop against it.

Resources

🛠️

Gear We Recommend

Running this in a home lab? Here’s the gear that keeps our test environment reliable.

Browse our Home Lab Essentials picks on Amazon

As an Amazon Associate, TechyGeeksHome earns from qualifying purchases.


Discover more from TechyGeeksHome

Subscribe to get the latest posts sent to your email.

Andrew Armstrong

Andrew Armstrong is a UK-based IT professional with 26+ years of hands-on experience in Windows, Windows Server, SCCM/ConfigMgr, Active Directory, PowerShell, and enterprise infrastructure.

He founded TechyGeeksHome in 2010 and has published over 1,500 practical guides covering real-world IT problems and solutions. When not solving IT problems,

Andrew develops free Windows utilities including Ultimate Settings Panel, which has been downloaded over 850,000 times.