In partnership with

THE PROBLEM

Print is the service everyone mocks and nobody monitors.

It also generates more helpdesk tickets than almost anything else, and the failures are uniquely annoying because they're partial. The spooler doesn't go down cleanly — it hangs. Queues don't empty — one job jams and everything behind it stops. The printer isn't offline — it's "offline" in the Windows sense, which means something entirely different and clears itself when someone power-cycles it.

The classic failure chain: a single corrupt print job sits at the head of a queue. Jobs pile up behind it. Users resubmit, which adds more jobs. The spool folder fills. Eventually the spooler service becomes unresponsive, which takes down every queue on the server simultaneously — including the ones that were working fine.

Nobody sees this until the third person calls. By then the queue has four hundred jobs in it and the only clean fix is stopping the spooler, clearing the spool folder, and starting it again, which deletes everyone's pending work.

The other thing worth knowing is that Print Spooler has been a recurring source of serious vulnerabilities — PrintNightmare being the most prominent — which means a spooler running on a server that doesn't need it is a genuine attack surface, not just wasted memory. Domain controllers in particular should not be running it.

This week we build the monitor.

THE SCRIPT

Save the script below to:

C:\Scripts\PrintServerMonitor.ps1

powershell

# Print Server & Spooler Health Monitor
# Automate & Operate — automateandoperate.com

# Email settings — update these
$from = "[email protected]"
$to = "[email protected]"
$smtpServer = "your.smtp.server"
$smtpPort = 587
$username = "[email protected]"
$password = ConvertTo-SecureString "yourpassword" -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential($username, $password)

$logFile = "C:\Logs\PrintServerMonitor.log"
$reportFile = "C:\Logs\PrintServerReport.csv"
$queueReportFile = "C:\Logs\PrintQueueReport.csv"

# Print servers to monitor. Leave empty to auto-discover from AD
# (any server with shared printers published).
$printServers = @()

# Also check whether the spooler is running where it should not be
$checkSpoolerOnAllServers = $true

# Thresholds
$stuckJobMinutes = 30          # job sitting in queue longer than this
$queueDepthWarning = 10        # jobs in a single queue
$queueDepthCritical = 50
$spoolFolderWarningMB = 500    # size of the spool directory
$spoolFolderCriticalMB = 2000

# Create log folder if missing
if (-not (Test-Path "C:\Logs")) {
    New-Item -ItemType Directory -Path "C:\Logs" -Force | Out-Null
}

$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$dateStamp = Get-Date -Format "yyyy-MM-dd"

$serverReport = @()
$queueReport = @()
$critical = @()
$warnings = @()
$stuckJobs = @()
$spoolerWhereNotNeeded = @()
$unreachable = @()

# ---------- DISCOVER PRINT SERVERS ----------
if ($printServers.Count -eq 0) {
    try {
        Import-Module ActiveDirectory -ErrorAction Stop

        # Published printers live under the computer object that shares them
        $published = Get-ADObject -LDAPFilter "(objectClass=printQueue)" `
            -Properties serverName -ErrorAction SilentlyContinue

        if ($published) {
            $printServers = $published.serverName |
                ForEach-Object { ($_ -split '\.')[0] } |
                Select-Object -Unique
        }

        if ($printServers.Count -eq 0) {
            Add-Content -Path $logFile -Value "$timestamp — No published print queues found, using localhost"
            $printServers = @("localhost")
        } else {
            Add-Content -Path $logFile -Value "$timestamp — Discovered $($printServers.Count) print server(s): $($printServers -join ', ')"
        }

    } catch {
        Add-Content -Path $logFile -Value "$timestamp — Discovery failed: $_ — using localhost"
        $printServers = @("localhost")
    }
}

# ---------- CHECK EACH PRINT SERVER ----------
foreach ($server in $printServers) {

    try {
        $data = Invoke-Command -ComputerName $server -ArgumentList $stuckJobMinutes -ScriptBlock {
            param($stuckMinutes)

            # Spooler service
            $spooler = Get-Service -Name Spooler -ErrorAction SilentlyContinue

            # Spool folder path and size
            $spoolPath = (Get-ItemProperty `
                "HKLM:\SYSTEM\CurrentControlSet\Control\Print\Printers" `
                -Name DefaultSpoolDirectory -ErrorAction SilentlyContinue).DefaultSpoolDirectory

            if (-not $spoolPath) { $spoolPath = "$env:SystemRoot\System32\spool\PRINTERS" }

            $spoolSizeMB = 0
            $spoolFileCount = 0
            if (Test-Path $spoolPath) {
                $spoolFiles = Get-ChildItem -Path $spoolPath -File -ErrorAction SilentlyContinue
                $spoolFileCount = $spoolFiles.Count
                if ($spoolFiles) {
                    $spoolSizeMB = [math]::Round((($spoolFiles | Measure-Object Length -Sum).Sum) / 1MB, 2)
                }
            }

            # Spooler process memory — a leaking spooler is a common failure
            $spoolerMemoryMB = 0
            try {
                $proc = Get-Process -Name spoolsv -ErrorAction SilentlyContinue
                if ($proc) { $spoolerMemoryMB = [math]::Round($proc.WorkingSet64 / 1MB, 1) }
            } catch { }

            # Printers
            $printers = @()
            $jobs = @()

            try {
                $printers = Get-Printer -ErrorAction Stop | ForEach-Object {
                    [PSCustomObject]@{
                        Name        = $_.Name
                        PortName    = $_.PortName
                        DriverName  = $_.DriverName
                        Shared      = $_.Shared
                        ShareName   = $_.ShareName
                        Published   = $_.Published
                        PrinterStatus = $_.PrinterStatus.ToString()
                    }
                }

                foreach ($printer in $printers) {
                    try {
                        $pJobs = Get-PrintJob -PrinterName $printer.Name -ErrorAction SilentlyContinue
                        foreach ($job in $pJobs) {
                            $ageMin = if ($job.SubmittedTime) {
                                [math]::Round((New-TimeSpan -Start $job.SubmittedTime -End (Get-Date)).TotalMinutes, 1)
                            } else { 0 }

                            $jobs += [PSCustomObject]@{
                                PrinterName = $printer.Name
                                JobId       = $job.Id
                                DocumentName = $job.DocumentName
                                UserName    = $job.UserName
                                JobStatus   = $job.JobStatus.ToString()
                                SubmittedTime = $job.SubmittedTime
                                AgeMinutes  = $ageMin
                                SizeKB      = [math]::Round($job.Size / 1KB, 1)
                                TotalPages  = $job.TotalPages
                            }
                        }
                    } catch { }
                }
            } catch { }

            # Driver inventory — mismatched drivers break clients
            $drivers = @()
            try {
                $drivers = Get-PrinterDriver -ErrorAction SilentlyContinue |
                    Select-Object Name, PrinterEnvironment, MajorVersion
            } catch { }

            # Port health — TCP/IP ports pointing at dead devices
            $ports = @()
            try {
                $ports = Get-PrinterPort -ErrorAction SilentlyContinue |
                    Where-Object { $_.PrinterHostAddress } |
                    Select-Object Name, PrinterHostAddress, PortNumber
            } catch { }

            # Recent spooler crashes from the event log
            $spoolerCrashes = 0
            try {
                $crashes = Get-WinEvent -FilterHashtable @{
                    LogName   = "Application"
                    Id        = 1000, 1001
                    StartTime = (Get-Date).AddDays(-7)
                } -ErrorAction SilentlyContinue | Where-Object { $_.Message -match "spoolsv" }
                $spoolerCrashes = ($crashes | Measure-Object).Count
            } catch { }

            [PSCustomObject]@{
                SpoolerStatus   = if ($spooler) { $spooler.Status.ToString() } else { "NOT INSTALLED" }
                SpoolerStartType = if ($spooler) { $spooler.StartType.ToString() } else { "N/A" }
                SpoolPath       = $spoolPath
                SpoolSizeMB     = $spoolSizeMB
                SpoolFileCount  = $spoolFileCount
                SpoolerMemoryMB = $spoolerMemoryMB
                Printers        = $printers
                Jobs            = $jobs
                Drivers         = $drivers
                Ports           = $ports
                SpoolerCrashes  = $spoolerCrashes
                IsDC            = ((Get-CimInstance Win32_ComputerSystem).DomainRole -in 4,5)
            }

        } -ErrorAction Stop

        # ---- Evaluate the server ----
        $serverFlags = @()

        if ($data.SpoolerStatus -ne "Running") {
            $serverFlags += "SPOOLER $($data.SpoolerStatus)"
        }

        if ($data.SpoolSizeMB -ge $spoolFolderCriticalMB) {
            $serverFlags += "SPOOL FOLDER $($data.SpoolSizeMB) MB"
        } elseif ($data.SpoolSizeMB -ge $spoolFolderWarningMB) {
            $serverFlags += "spool folder $($data.SpoolSizeMB) MB"
        }

        if ($data.SpoolerCrashes -gt 0) {
            $serverFlags += "$($data.SpoolerCrashes) SPOOLER CRASH(ES) IN 7 DAYS"
        }

        if ($data.SpoolerMemoryMB -gt 500) {
            $serverFlags += "spoolsv using $($data.SpoolerMemoryMB) MB"
        }

        if ($data.IsDC -and $data.SpoolerStatus -eq "Running") {
            $serverFlags += "SPOOLER RUNNING ON DOMAIN CONTROLLER"
            $spoolerWhereNotNeeded += "$server (domain controller)"
        }

        $totalJobs = ($data.Jobs | Measure-Object).Count
        $errorPrinters = ($data.Printers | Where-Object { $_.PrinterStatus -match "Error|Offline|PaperOut|PaperJam" }).Count

        $serverStatus = if ($serverFlags -match "SPOOLER Stopped|SPOOLER CRASH|SPOOL FOLDER|RUNNING ON DOMAIN CONTROLLER") {
            "CRITICAL"
        } elseif ($serverFlags.Count -gt 0 -or $errorPrinters -gt 0) {
            "WARNING"
        } else {
            "OK"
        }

        $serverEntry = [PSCustomObject]@{
            Date            = $dateStamp
            Server          = $server
            SpoolerStatus   = $data.SpoolerStatus
            SpoolerStartType = $data.SpoolerStartType
            SpoolSizeMB     = $data.SpoolSizeMB
            SpoolFileCount  = $data.SpoolFileCount
            SpoolerMemoryMB = $data.SpoolerMemoryMB
            SpoolerCrashes7d = $data.SpoolerCrashes
            PrinterCount    = ($data.Printers | Measure-Object).Count
            SharedCount     = ($data.Printers | Where-Object { $_.Shared }).Count
            DriverCount     = ($data.Drivers | Measure-Object).Count
            TotalJobs       = $totalJobs
            PrintersInError = $errorPrinters
            IsDC            = $data.IsDC
            Status          = $serverStatus
            Flags           = if ($serverFlags.Count -gt 0) { $serverFlags -join "; " } else { "OK" }
        }

        $serverReport += $serverEntry
        if ($serverStatus -eq "CRITICAL") { $critical += $serverEntry }
        if ($serverStatus -eq "WARNING")  { $warnings += $serverEntry }

        # ---- Evaluate each queue ----
        foreach ($printer in $data.Printers) {

            $printerJobs = $data.Jobs | Where-Object { $_.PrinterName -eq $printer.Name }
            $jobCount = ($printerJobs | Measure-Object).Count
            $oldestJob = $printerJobs | Sort-Object AgeMinutes -Descending | Select-Object -First 1

            $qFlags = @()

            if ($jobCount -ge $queueDepthCritical) {
                $qFlags += "$jobCount JOBS QUEUED"
            } elseif ($jobCount -ge $queueDepthWarning) {
                $qFlags += "$jobCount jobs queued"
            }

            if ($oldestJob -and $oldestJob.AgeMinutes -ge $stuckJobMinutes) {
                $qFlags += "STUCK JOB: $($oldestJob.AgeMinutes) min old"
                $stuckJobs += [PSCustomObject]@{
                    Server      = $server
                    Printer     = $printer.Name
                    JobId       = $oldestJob.JobId
                    Document    = $oldestJob.DocumentName
                    User        = $oldestJob.UserName
                    AgeMinutes  = $oldestJob.AgeMinutes
                    JobStatus   = $oldestJob.JobStatus
                    QueueDepth  = $jobCount
                }
            }

            if ($printer.PrinterStatus -match "Error|Offline|PaperOut|PaperJam|Paused") {
                $qFlags += "PRINTER STATUS: $($printer.PrinterStatus)"
            }

            if ($printerJobs | Where-Object { $_.JobStatus -match "Error|Blocked" }) {
                $qFlags += "JOB IN ERROR STATE"
            }

            $qStatus = if ($qFlags -match "JOBS QUEUED|STUCK JOB|JOB IN ERROR") {
                "CRITICAL"
            } elseif ($qFlags.Count -gt 0) {
                "WARNING"
            } else {
                "OK"
            }

            $queueReport += [PSCustomObject]@{
                Date          = $dateStamp
                Server        = $server
                PrinterName   = $printer.Name
                ShareName     = $printer.ShareName
                PortName      = $printer.PortName
                DriverName    = $printer.DriverName
                PrinterStatus = $printer.PrinterStatus
                JobCount      = $jobCount
                OldestJobMin  = if ($oldestJob) { $oldestJob.AgeMinutes } else { 0 }
                Status        = $qStatus
                Flags         = if ($qFlags.Count -gt 0) { $qFlags -join "; " } else { "OK" }
            }
        }

        Add-Content -Path $logFile -Value "$timestamp — $server — spooler $($data.SpoolerStatus) — $($serverEntry.PrinterCount) printer(s) — $totalJobs job(s) — spool $($data.SpoolSizeMB)MB — $serverStatus"

    } catch {
        $unreachable += [PSCustomObject]@{
            Server = $server
            Reason = $_.Exception.Message
        }
        Add-Content -Path $logFile -Value "$timestamp — $server — ERROR: $_"
    }
}

# ---------- SPOOLER WHERE IT SHOULDN'T BE ----------
if ($checkSpoolerOnAllServers) {
    try {
        Import-Module ActiveDirectory -ErrorAction Stop
        $allServers = (Get-ADComputer -Filter {
            Enabled -eq $true -and OperatingSystem -like "*Server*"
        } -Properties OperatingSystem).Name

        $nonPrintServers = $allServers | Where-Object { $printServers -notcontains $_ }

        foreach ($srv in $nonPrintServers) {
            try {
                $spoolCheck = Invoke-Command -ComputerName $srv -ScriptBlock {
                    $svc = Get-Service -Name Spooler -ErrorAction SilentlyContinue
                    $printerCount = (Get-Printer -ErrorAction SilentlyContinue |
                        Where-Object { $_.Name -notmatch "Microsoft|OneNote|Fax|PDF" } | Measure-Object).Count
                    $isDC = ((Get-CimInstance Win32_ComputerSystem).DomainRole -in 4,5)

                    [PSCustomObject]@{
                        Status = if ($svc) { $svc.Status.ToString() } else { "NOT INSTALLED" }
                        StartType = if ($svc) { $svc.StartType.ToString() } else { "N/A" }
                        RealPrinters = $printerCount
                        IsDC = $isDC
                    }
                } -ErrorAction Stop

                if ($spoolCheck.Status -eq "Running" -and $spoolCheck.RealPrinters -eq 0) {
                    $label = if ($spoolCheck.IsDC) { "$srv (DOMAIN CONTROLLER)" } else { $srv }
                    $spoolerWhereNotNeeded += "$label — spooler running, no printers installed"
                }

            } catch { }
        }

        Add-Content -Path $logFile -Value "$timestamp — Checked spooler state on $($nonPrintServers.Count) non-print server(s)"

    } catch {
        Add-Content -Path $logFile -Value "$timestamp — Could not enumerate servers for spooler check: $_"
    }
}

# ---------- EXPORT ----------
$serverReport | Sort-Object Status, Server | Export-Csv -Path $reportFile -NoTypeInformation
$queueReport | Sort-Object Status, Server, PrinterName | Export-Csv -Path $queueReportFile -NoTypeInformation

# ---------- BUILD EMAIL ----------
$criticalQueues = $queueReport | Where-Object { $_.Status -eq "CRITICAL" }
$warningQueues  = $queueReport | Where-Object { $_.Status -eq "WARNING" }
$deadSpoolers   = $serverReport | Where-Object { $_.SpoolerStatus -ne "Running" }

$emailBody  = "Print Server Health Report — $timestamp`n"
$emailBody += "Print servers checked: $($printServers.Count)  |  Unreachable: $($unreachable.Count)`n"
$emailBody += "Total printers: $(($serverReport | Measure-Object PrinterCount -Sum).Sum)`n"
$emailBody += "Total queued jobs: $(($serverReport | Measure-Object TotalJobs -Sum).Sum)`n`n"
$emailBody += "Spoolers down: $($deadSpoolers.Count)`n"
$emailBody += "Stuck jobs: $($stuckJobs.Count)`n"
$emailBody += "Queues critical: $($criticalQueues.Count)  |  warning: $($warningQueues.Count)`n"
$emailBody += "Spooler running where not needed: $($spoolerWhereNotNeeded.Count)`n`n"

if ($deadSpoolers.Count -gt 0) {
    $emailBody += "*** SPOOLER NOT RUNNING — ALL PRINTING DOWN ON THESE SERVERS ***`n"
    $emailBody += "=" * 60 + "`n"
    foreach ($d in $deadSpoolers) {
        $emailBody += "Server:     $($d.Server)`n"
        $emailBody += "Spooler:    $($d.SpoolerStatus) (startup: $($d.SpoolerStartType))`n"
        $emailBody += "Printers:   $($d.PrinterCount) ($($d.SharedCount) shared)`n"
        $emailBody += "Spool dir:  $($d.SpoolSizeMB) MB, $($d.SpoolFileCount) file(s)`n"
        $emailBody += "-" * 40 + "`n"
    }
    $emailBody += "`nRestart: Restart-Service -Name Spooler -Force`n`n"
}

if ($stuckJobs.Count -gt 0) {
    $emailBody += "STUCK PRINT JOBS (older than $stuckJobMinutes minutes):`n"
    $emailBody += "=" * 60 + "`n"
    foreach ($s in ($stuckJobs | Sort-Object AgeMinutes -Descending)) {
        $emailBody += "Server:   $($s.Server)`n"
        $emailBody += "Printer:  $($s.Printer)`n"
        $emailBody += "Document: $($s.Document)`n"
        $emailBody += "User:     $($s.User)`n"
        $emailBody += "Age:      $($s.AgeMinutes) minutes  |  Status: $($s.JobStatus)`n"
        $emailBody += "Queue:    $($s.QueueDepth) job(s) waiting behind it`n"
        $emailBody += "-" * 40 + "`n"
    }
    $emailBody += "`nClear a single job:`n"
    $emailBody += "  Remove-PrintJob -PrinterName 'NAME' -ID <jobid> -ComputerName 'SERVER'`n`n"
}

if ($criticalQueues.Count -gt 0) {
    $emailBody += "QUEUES NEEDING ATTENTION:`n"
    $emailBody += "=" * 60 + "`n"
    foreach ($q in $criticalQueues) {
        $emailBody += "$($q.Server) \ $($q.PrinterName)`n"
        $emailBody += "   Jobs: $($q.JobCount)  |  Oldest: $($q.OldestJobMin) min  |  Status: $($q.PrinterStatus)`n"
        $emailBody += "   $($q.Flags)`n"
    }
    $emailBody += "`n"
}

if ($spoolerWhereNotNeeded.Count -gt 0) {
    $emailBody += "SPOOLER RUNNING WHERE IT IS NOT NEEDED:`n"
    $emailBody += "Print Spooler has a history of serious vulnerabilities. Disable it`n"
    $emailBody += "on servers with no printers, especially domain controllers.`n"
    $emailBody += "=" * 60 + "`n"
    $spoolerWhereNotNeeded | ForEach-Object { $emailBody += "  !! $_`n" }
    $emailBody += "`nTo disable:`n"
    $emailBody += "  Stop-Service -Name Spooler -Force`n"
    $emailBody += "  Set-Service -Name Spooler -StartupType Disabled`n`n"
}

if ($warningQueues.Count -gt 0) {
    $emailBody += "QUEUE WARNINGS:`n"
    $emailBody += "=" * 60 + "`n"
    foreach ($q in $warningQueues) {
        $emailBody += "$($q.Server) \ $($q.PrinterName) — $($q.Flags)`n"
    }
    $emailBody += "`n"
}

$emailBody += "PRINT SERVER SUMMARY:`n"
$emailBody += "=" * 60 + "`n"
foreach ($s in $serverReport) {
    $emailBody += "[$($s.Status)] $($s.Server)$(if ($s.IsDC) { ' [DC]' })`n"
    $emailBody += "   Spooler: $($s.SpoolerStatus) | Memory: $($s.SpoolerMemoryMB) MB | Crashes (7d): $($s.SpoolerCrashes7d)`n"
    $emailBody += "   Printers: $($s.PrinterCount) ($($s.SharedCount) shared) | Drivers: $($s.DriverCount) | Jobs: $($s.TotalJobs)`n"
    $emailBody += "   Spool folder: $($s.SpoolSizeMB) MB in $($s.SpoolFileCount) file(s)`n"
    if ($s.Status -ne "OK") { $emailBody += "   ISSUES: $($s.Flags)`n" }
}

if ($unreachable.Count -gt 0) {
    $emailBody += "`nUNREACHABLE:`n"
    $emailBody += "=" * 60 + "`n"
    foreach ($u in $unreachable) { $emailBody += "$($u.Server) — $($u.Reason)`n" }
}

if ($deadSpoolers.Count -eq 0 -and $stuckJobs.Count -eq 0 -and $criticalQueues.Count -eq 0) {
    $emailBody += "`nAll spoolers running, no stuck jobs, all queues clear.`n"
}

$emailBody += "`nServer report: $reportFile`n"
$emailBody += "Queue report: $queueReportFile`n`n"
$emailBody += "Useful commands:`n"
$emailBody += "  Get-Printer -ComputerName SERVER`n"
$emailBody += "  Get-PrintJob -PrinterName 'NAME' -ComputerName SERVER`n"
$emailBody += "  Restart-Service Spooler -Force`n"
$emailBody += "  Get-PrinterDriver -ComputerName SERVER`n`n"
$emailBody += "Automate & Operate — automateandoperate.com"

$subject = if ($deadSpoolers.Count -gt 0) {
    "*** PRINT CRITICAL: spooler down on $($deadSpoolers.Count) server(s) ***"
} elseif ($stuckJobs.Count -gt 0) {
    "PRINT ALERT: $($stuckJobs.Count) stuck job(s) blocking queues"
} elseif ($spoolerWhereNotNeeded.Count -gt 0) {
    "Print Report — spooler running unnecessarily on $($spoolerWhereNotNeeded.Count) server(s)"
} elseif ($criticalQueues.Count -gt 0) {
    "Print Report — $($criticalQueues.Count) queue(s) need attention"
} else {
    "Print Server Health — All queues clear"
}

Send-MailMessage `
    -From $from -To $to `
    -Subject $subject `
    -Body $emailBody `
    -SmtpServer $smtpServer -Port $smtpPort `
    -UseSsl -Credential $credential

Update these lines:

  • $from / $to / $username / $password — your email details

  • $smtpServer — your SMTP server (e.g. smtp.office365.com)

  • $printServers — leave empty to auto-discover from published queues in AD

  • $stuckJobMinutes — 30 is reasonable; lower it if your printers are fast

  • $checkSpoolerOnAllServers — set $false if the fleet-wide sweep is too slow

Requirements: PowerShell remoting and admin rights on the print servers. The Get-Printer cmdlets need the PrintManagement module, present by default on Server 2012 R2 onward.

THE STUCK JOB IS THE HIGH-VALUE FINDING

Queue depth alone isn't interesting — a busy printer at lunchtime legitimately has fifteen jobs waiting and they'll clear in five minutes.

What matters is age. A job that's been sitting for 45 minutes is not printing, and everything behind it is blocked. That's the difference between a busy queue and a jammed one.

The report gives you the document name, the user, and how many jobs are stacked behind it. That's enough to act without logging into anything — you know who to tell, and you know whether it's one person affected or thirty.

Clearing a single job:

powershell

Remove-PrintJob -ComputerName "PRINTSRV01" -PrinterName "HP-Finance-2F" -ID 42

If the job won't delete — which happens when the spooler has it half-written to disk — you need the heavier approach:

powershell

Stop-Service Spooler -Force
Remove-Item "$env:SystemRoot\System32\spool\PRINTERS\*" -Force
Start-Service Spooler

That clears every queue on the server, so it's a last resort. Tell people before you do it.

WHY THE SPOOLER CHECK ON NON-PRINT SERVERS MATTERS

This section catches something most environments have and nobody notices.

Print Spooler runs by default on every Windows installation, whether or not that machine will ever print anything. It has had a steady stream of serious remote code execution and privilege escalation vulnerabilities, PrintNightmare being the one that made the news but by no means the only one.

A spooler running on a domain controller is the worst case. It's a documented attack path, it's exploitable from a standard user account in some configurations, and there is almost never a reason for a DC to be a print server.

The script sweeps every server that isn't a known print server, checks whether the spooler is running, and whether any real printers are installed. Running with zero printers means the service is pure attack surface.

Disabling it:

powershell

Stop-Service -Name Spooler -Force
Set-Service -Name Spooler -StartupType Disabled

Do it via Group Policy for anything at scale — a GPO targeting your server OU with the Print Spooler service set to Disabled, with an exclusion for the print server OU.

One caveat before you disable broadly: some applications enumerate printers at startup even if they never print, and a few will throw errors or hang if the spooler is unavailable. Test on one server per application tier before rolling it out. The usual suspects are older reporting tools and some line-of-business apps built on Crystal Reports.

THE SPOOLER CRASH COUNT

The script pulls Application log events 1000 and 1001 from the last seven days and filters for spoolsv.

A spooler that crashes and restarts looks healthy by the time you check it — the service is running, the queues are there. But the crash took every in-flight job with it, which is why three people mentioned "my print job just vanished" last Tuesday and nobody connected them.

Repeated crashes almost always trace to a bad driver. Which one is harder, but the pattern usually points at it — crashes cluster around a particular printer model, or started after a driver update.

The modern answer is Print Isolation, which runs drivers in a separate process so a bad one takes down only itself:

powershell

# Check current isolation mode per driver
Get-PrinterDriver | Select-Object Name, PrintProcessor

# Set a printer's driver to isolated
Set-Printer -Name "Problem-Printer" -RenderingMode SSR

Better still, use Type 4 drivers where the hardware supports them. They're designed to be driver-independent on the client side and they're substantially more stable.

THE SPOOL FOLDER SIZE

C:\Windows\System32\spool\PRINTERS should be close to empty most of the time — jobs land there, print, and get deleted.

A spool folder at 2GB means jobs aren't being cleaned up. Usually there's a corrupt .SPL or .SHD file that the spooler can't process and can't delete, so it sits there forever while new jobs accumulate around it.

Worth watching specifically because it's a disk-space problem that fills the system volume, and a full C: drive on a print server is a much bigger outage than a stuck queue.

SETTING UP TASK SCHEDULER

  1. Press Windows key → type Task Scheduler → open it

  2. Click "Create Basic Task" → name it Print Server Monitor

  3. Trigger: Daily → 8:00am

  4. Action: Start a program

  5. Program: powershell.exe

  6. Arguments:

-ExecutionPolicy Bypass -File "C:\Scripts\PrintServerMonitor.ps1"
  1. Click Next → Finish

Under Properties → General, check "Run with highest privileges".

Consider running this more often than daily. Print problems are time-sensitive in a way that most of the things in this series aren't — a stuck queue at 9am that you learn about at 8am the next day is a wasted day for whoever needed that document.

Every two hours during business hours is reasonable. Set the trigger to Daily at 7:00am, then under Triggers → Edit, repeat every 2 hours for a duration of 12 hours.

The fleet-wide spooler sweep is the slow part. If you enable the frequent schedule, set $checkSpoolerOnAllServers = $false on the frequent job and run a separate weekly job with it enabled.

TEST IT

Run as administrator:

powershell

powershell.exe -ExecutionPolicy Bypass -File "C:\Scripts\PrintServerMonitor.ps1"

Check what one server returns first:

powershell

Get-Printer -ComputerName "PRINTSRV01" | Select-Object Name, PrinterStatus, PortName, Shared
Get-Service -Name Spooler -ComputerName "PRINTSRV01"

To see current jobs across every queue on a server:

powershell

Get-Printer -ComputerName "PRINTSRV01" | ForEach-Object {
    Get-PrintJob -PrinterName $_.Name -ComputerName "PRINTSRV01" -ErrorAction SilentlyContinue
} | Select-Object PrinterName, Id, DocumentName, UserName, JobStatus, SubmittedTime

To find spoolers running where they shouldn't, as a quick one-off:

powershell

Get-ADComputer -Filter { OperatingSystem -like "*Server*" -and Enabled -eq $true } |
    ForEach-Object {
        $svc = Get-Service -Name Spooler -ComputerName $_.Name -ErrorAction SilentlyContinue
        if ($svc.Status -eq "Running") { [PSCustomObject]@{ Server = $_.Name; Spooler = $svc.Status } }
    }

Run that against your DCs specifically. If any come back Running, that's today's job.

WHY THIS MATTERS

Print gets dismissed as a trivial service, and that dismissal is exactly why it generates so much unplanned work. It's not monitored, so failures are discovered by users. It's not owned by anyone specifically, so fixes are reactive. And it's assumed to be low-risk, so the spooler runs everywhere including on machines where it's a genuine liability.

The helpdesk volume alone justifies the monitoring. A stuck queue caught at 8am and cleared in two minutes is a non-event. The same queue found at 2pm after six people called is an afternoon.

And the spooler-on-domain-controllers finding is one of those things that takes five minutes to fix and would take a very uncomfortable meeting to explain if it were ever exploited.

THIS WEEK'S ACTION

Run the one-liner above against your domain controllers right now. If Print Spooler is running on any of them and they're not print servers, disable it today. Then set the full script running so you stop hearing about stuck queues from users first.

Reply to this email if you hit any issues — I read every reply.

Automate & Operate — automateandoperate.com

The Dell Pro keeps your day moving.

Built for those who stay in the flow.

Handle the busiest days by staying in the flow with built-in intelligence on the Dell Pro laptop powered by Intel® Core™ Ultra with Intel vPro®.