In modern enterprise environments and home offices alike, managing local and networked printing infrastructure is an essential administrative task. When documents become stuck in a queue or printers fail to communicate, resolving the issue via the Windows 11 graphical user interface can often be slow or unresponsive. Windows PowerShell provides a fast, robust alternative through the built-in PrintManagement module, offering native cmdlets to audit hardware configurations, inspect active print queues, cancel stalled print jobs, and recycle the Print Spooler service.
In this technical guide, you will learn how to query installed printers, inspect pending documents, cancel or pause print jobs, and automate print queue recovery in Windows 11 using native PowerShell commands.
Verifying and Querying Installed Printers in Windows 11
To inspect every printer recognised by Windows 11—including physical USB units, Wi-Fi network printers, and virtual document printers such as Microsoft Print to PDF—launch an elevated PowerShell console by pressing Windows Key + X and selecting Terminal (Admin) or PowerShell (Admin).
Execute the Get-Printer cmdlet to display basic details:
Get-Printer
To produce a cleaner, structured report highlighting operational status, port assignments, and driver versions, pipe the output into Select-Object and Format-Table:
Get-Printer | Select-Object Name, DriverName, PortName, PrinterStatus, Shared, Published | Format-Table -AutoSize
If you need to identify the current default printer assigned to the operating system, execute the following query:
Get-CimInstance -ClassName Win32_Printer | Where-Object { $_.Default -eq $true } | Select-Object Name, PortName, DriverName, DeviceID
Inspecting Active Print Queues and Stalled Jobs
When a document fails to output, it often blocks all subsequent jobs queued behind it. You can inspect pending jobs across all printers or target a specific device using Get-PrintJob.
To view all pending print jobs across all connected printers, run:
Get-Printer | Get-PrintJob | Select-Object PrinterName, ID, DocumentName, UserName, JobStatus, TotalPages, Size, Submitted | Format-Table -AutoSize
To target a single printer whose queue appears frozen, specify the printer name:
Get-PrintJob -PrinterName "Office-LaserJet"
Pay close attention to the JobStatus property. Common status indicators include Printing, Paused, Error, Deleting, or Spooling. A status of Deleting that persists for several minutes typically indicates a file lock in the Windows print spool directory.
Managing, Pausing, and Removing Print Jobs
PowerShell provides granular cmdlets to manipulate individual jobs within a queue without requiring a complete system reboot.
1. Pausing and Resuming a Print Job
If you need to halt a large print job temporarily while replacing paper or toner cartridges, pass the printer name and job ID to Suspend-PrintJob:
# Pause job ID 14
Suspend-PrintJob -PrinterName "Office-LaserJet" -ID 14
# Resume job ID 14
Resume-PrintJob -PrinterName "Office-LaserJet" -ID 14
2. Restarting a Failed Job
If a print job encountered a paper jam and you wish to restart printing from the beginning, use Restart-PrintJob:
Restart-PrintJob -PrinterName "Office-LaserJet" -ID 14
3. Removing a Single Stuck Job
To cancel and delete an erroneous print job from the spooler:
Remove-PrintJob -PrinterName "Office-LaserJet" -ID 14
4. Purging All Queued Jobs on a Printer
To completely clear every pending document waiting on a specific printer:
Get-PrintJob -PrinterName "Office-LaserJet" | Remove-PrintJob
Automating Print Spooler Cleanup for Stubborn Queues
In certain scenarios, a corrupted document locks files on disk, preventing Remove-PrintJob from clearing the queue. Windows stores active print files as .SPL (spool files) and .SHD (shadow files) inside C:\Windows\System32\spool\PRINTERS.
To resolve persistent queue locks, execute this consolidated PowerShell script in an elevated console:
# Stop the Windows Print Spooler service
Write-Host "Stopping Print Spooler service..." -ForegroundColor Yellow
Stop-Service -Name Spooler -Force
# Delete locked spooler files
$SpoolPath = "$env:SystemRoot\System32\spool\PRINTERS\*"
Write-Host "Purging temporary spooler files..." -ForegroundColor Yellow
Remove-Item -Path $SpoolPath -Force -Recurse -ErrorAction SilentlyContinue
# Restart the Print Spooler service
Write-Host "Restarting Print Spooler service..." -ForegroundColor Green
Start-Service -Name Spooler
# Verify service status
Get-Service -Name Spooler | Select-Object Name, Status, StartType
This sequence cleanly terminates any active lock handles, purges the orphaned cache files, and restarts the printing subsystem in a clean state.
Exporting Printer Inventory and Configurations
For system auditing, disaster recovery, or hardware migration, you can export your complete printer inventory, driver lists, and port mappings to a structured CSV file:
Get-Printer | Select-Object Name, Type, DriverName, PortName, Shared, ShareName, Location | Export-Csv -Path "$HOME\Desktop\Windows11_Printers_Audit.csv" -NoTypeInformation
This file can be opened directly in Microsoft Excel to review printer fleets or track driver versions across your environment.
Troubleshooting Common Print Management Issues
- Access Denied Errors: Removing jobs submitted by other domain users or modifying system-level printer properties requires administrative elevation. Ensure PowerShell is running as an administrator.
- The Spooler Service Fails to Stop: If
Stop-Service -Name Spoolerhangs, a third-party print monitor or PDF writer DLL may be hanging in memory. You can force-terminate the spooler process usingStop-Process -Name spoolsv -Force, though using the service cmdlet is always preferred. - Network Printer Offline: If a network printer displays an offline status despite being powered on, inspect port connectivity using PowerShell’s network testing cmdlet:
If port 9100 (standard RAW printing port) is open, check whether SNMP status checking is improperly flagging the device as offline in printer port properties.Test-NetConnection -ComputerName "192.168.1.150" -Port 9100
Frequently Asked Questions
Can I manage print queues on remote Windows computers using PowerShell?
Yes. If PowerShell Remoting (WinRM) is enabled, you can run commands against remote computers using Invoke-Command -ComputerName "PC-WORKSTATION" -ScriptBlock { Get-Printer } or pass the -ComputerName parameter directly to CIM cmdlets.
Does clearing the spooler folder delete my installed printer drivers?
No. Deleting the files inside C:\Windows\System32\spool\PRINTERS only deletes active temporary print job data (.SPL and .SHD). Installed print drivers, INF files, and printer device configurations are stored safely in the driver repository and registry.
How do I set the default printer using PowerShell?
You can set the default printer by invoking the WScript.Network COM object in PowerShell:
(New-Object -ComObject WScript.Network).SetDefaultPrinter('Office-LaserJet')
This immediately updates the Windows default printer selection for the active user session.
Can I restart a print job that has already finished printing?
Once a print job has successfully completed and is cleared from the spooler cache, it cannot be restarted from PowerShell because the temporary spool files are deleted. The originating application must resend the print job.