Library / Windows endpoint

WIN-022 · Script

Printer Spooler Reset and Queue Clear

Checks the print spooler for stuck jobs and, in Fix mode, stops it, clears the queue and starts it again.

Version 1.0.0Language PowerShellUpdated November 2026

What it does

Reports the state of the Print Spooler service, every print job that is in an error state or older than -StuckMinutes, and the number of leftover spool files in the spool folder (read from the registry, so a moved spool folder is handled).

Report mode (default) changes nothing and logs what Fix would do. Fix mode stops the spooler, deletes the files in the spool folder (the queued jobs), sets the service back to Automatic if it was disabled, starts it again and confirms it is running. By default Fix only acts when a problem is found; use -ForceReset to reset even when everything looks fine.

Printers, drivers and ports are never removed. Any job still in the queue is deleted in Fix mode, including jobs that were not stuck, so users may need to print again. Runs silently as SYSTEM from any RMM or Intune. No prompts, no user interaction.

Requirements

Windows PowerShell 5.1+, run as SYSTEM or local admin

How to run it

  • Run as: SYSTEM or a local administrator
  • Run from: any RMM or MDM, Intune, a Group Policy startup script, a scheduled task, or an elevated PowerShell window
  • Script type: PowerShell, 64-bit
  • User interaction: none; the script never prompts
  • Timeout: 10 minutes (30 for Windows Update installs)

Settings

NameWhat it doesOptionsDefault
ModeReport (default) = read-only. Fix = stop the spooler, clear the queue and start it again.Report, FixReport
StuckMinutesA job older than this many minutes counts as stuck. Default 30. Example: 60.30
ForceResetIn Fix mode, reset the spooler even when no problem is found.False

Exit codes

  • 0 = Spooler healthy, or reset done and spooler running
  • 1 = Problem found (Report), or spooler not running after Fix
  • 2 = Script error

Testing steps

  1. Run it first with the mode set to Report on one test device. Nothing is changed in that mode.
  2. Read the log and confirm the planned changes are what you expect.
  3. Run your chosen settings on the same test target and confirm the result.
  4. Check the exit code: 0 = OK, 1 = needs attention, 2 = error (see log), 9 = this copy is past its Valid until date.
  5. Roll out to a small group next, then everyone.

Rollback steps

Nothing to restore for printers, drivers or ports, which are never touched. Jobs deleted from the queue cannot be recovered; users print again. If Fix changed a disabled spooler to Automatic, set it back with: Set-Service -Name Spooler -StartupType Disabled; Stop-Service Spooler.

Version and change log

VersionDateChanges
1.0.0November 2026First release.