Fix SPAPI_E_BAD_SERVICE_INSTALLSECT (0x800F0217) on Windows Server
This error means Windows can't install a driver or feature because the INF file's service install section is broken. Usually a bad driver or corrupted system file.
You're staring at 0x800F0217 — SPAPI_E_BAD_SERVICE_INSTALLSECT — and Windows won't install a driver or a server role feature. The message says a service installation section in this INF is invalid. That's Microsoft-speak for: the INF file is broken, corrupted, or missing required entries. I've seen this on Server 2016, 2019, and 2022 boxes mostly after a failed driver update or a botched Windows update.
Here's the kicker: most of the time it's not the driver itself — it's a corrupt system file or a lingering bad driver from a previous install. Let me walk you through the three most common causes, ranked by how often they show up in my repair queue.
1. Corrupt system files from a failed update
This is what I see 7 out of 10 times. A Windows update fails halfway through, leaves a mangled component store, and now any attempt to install a new driver or role hits 0x800F0217. The INF files in your system's driver store (C:\Windows\System32\DriverStore) are trash.
Fix:
- Open Command Prompt as Administrator. Don't use PowerShell for this — real talk, DISM behaves better in cmd.
- Run:
DISM /Online /Cleanup-Image /RestoreHealth - Let it finish. This can take 15-40 minutes depending on your server's speed. Don't cancel it.
- After that, run:
sfc /scannow - Reboot. Then try your driver or feature install again.
Had a client last month whose entire print queue died because of this — they'd installed a faulty printer driver update, got this error, and their print spooler wouldn't work. DISM fixed it in 20 minutes.
If DISM fails because it can't find the source files (common on offline servers), you'll need the original Windows Server ISO. Mount it and point DISM to it:
DISM /Online /Cleanup-Image /RestoreHealth /Source:G:\sources\install.wim /LimitAccess
Replace G: with your mounted ISO drive letter.
2. Bad third-party driver INF — the one you just tried to install
Second most common scenario: you downloaded a driver (maybe for a RAID controller, NIC, or graphics card) and the INF file itself is garbage. The ServiceInstall section — which tells Windows how to start the driver service — is missing or has bad syntax.
Quick check: Open the INF file with Notepad. Look for a section like:
[YourServiceName_Inst.Services]
AddService = YourServiceName, 0x00000002, Service_Inst
If that section isn't there, or if Service_Inst doesn't exist later in the file, the INF is trash. Don't waste time editing it — get a fresh copy from the vendor's site. Make sure it's the exact driver for your Windows Server version (2016, 2019, 2022 have differences).
Fix:
- Uninstall the failed driver attempt: Go to Device Manager, find the device with the yellow bang, right-click and Uninstall device. Check the box for Delete the driver software for this device.
- Run Disk Cleanup (cleanmgr.exe) to purge leftover driver files.
- Download the driver from the vendor's official site — not some third-party aggregator.
- Right-click the INF file and select Install, or use the vendor's installer.
One time a client had this error trying to install a Broadcom network driver on Server 2019. Turned out the vendor's download page defaulted to a Server 2016 driver. Different build number, broken INF. Grabbed the right one, problem gone.
3. Windows component store corruption from feature installs
This one's trickier. You're trying to add a Windows feature (like Hyper-V, Failover Clustering, or IIS) via Server Manager or PowerShell Install-WindowsFeature, and it fails with 0x800F0217. The INF files for the feature's service are corrupted in the component store.
Fix:
- First, run DISM as shown above — that fixes most store corruption.
- If the error persists, the feature's source files might be missing. Check the CBS log:
findstr /c:"0x800f0217" C:\Windows\Logs\CBS\CBS.log - You'll see a line pointing to a specific INF file, like
netvsc.inforvmswitch.inf. That's your culprit. - Force a feature uninstall and reinstall using PowerShell:
thenUninstall-WindowsFeature -Name Hyper-VInstall-WindowsFeature -Name Hyper-V -IncludeManagementTools - If that still fails, you need the ISO again. Mount it and run:
Install-WindowsFeature -Name Hyper-V -Source G:\sources\sxs
Skip the GUI here — PowerShell gives better error messages. And always check C:\Windows\Logs\DISM\dism.log for details.
Quick-Reference Summary Table
| Cause | Likeliest Fix | Tools Needed |
|---|---|---|
| Corrupt system files from failed update | DISM /RestoreHealth, then SFC | Command Prompt (Admin) |
| Bad third-party driver INF | Delete driver files, download correct version from vendor | Device Manager, vendor website |
| Store corruption from feature install | DISM, then uninstall/reinstall feature with -Source ISO | PowerShell, mounted ISO |
Bottom line: start with DISM. It fixes the bulk of these errors. If that doesn't work, check your driver source. And never install drivers from random sites — I've seen INF files with missing sections that cause this exact headache. You've got this.
Was this solution helpful?