Clear Print: Queue Cmd
Get-Printer | Get-PrintJob Get-PrintJob -PrinterName "HP-LaserJet-4015" | Remove-PrintJob 4.4 Deleting a Specific Job by ID Remove-PrintJob -PrinterName "HP-LaserJet-4015" -JobId 7 4.5 Conditional Deletion Examples Delete jobs by document name pattern:
Get-PrintJob -PrinterName "HP-LaserJet-4015" | Where-Object $_.UserName -eq "jdoe" | Remove-PrintJob For remote computers, use Invoke-Command :
cscript prnjobs.vbs -l -s \\printserver -p "PrinterName" cscript prnjobs.vbs -d -s \\printserver -p "PrinterName" -j 5 This script is no longer present in modern Windows by default. Stopping and clearing the spooler service is a brute-force method: clear print queue cmd
net print \\server_name\printer_share To clear all jobs from a queue:
try Get-PrintJob -PrinterName "Missing-Printer" -ErrorAction Stop catch Write-Warning "Printer not found or inaccessible: $_" it appears in many existing scripts.
Get-PrintJob -PrinterName "HP-LaserJet-4015" | Where-Object $_.DocumentName -like "*confidential*" | Remove-PrintJob Delete jobs older than 1 hour:
net print \\server_name\printer_share /delete To delete a specific job by ID: net print is inadequate for modern
\\printserver\HP-LaserJet-4015 Job 5 Document user1 1024 bytes Printing Job 7 Report.docx user2 2048 bytes Spooling The command completed successfully. While functional, net print is inadequate for modern, complex environments. Windows Management Instrumentation Command-line ( wmic ) provides a more structured interface to the print queue via the win32_printjob class. However, as of Windows 10 version 21H2 and Windows Server 2022, wmic is deprecated and disabled by default. Still, it appears in many existing scripts. 3.1 Listing Print Jobs wmic path win32_printjob get jobid, name, document, driverName, status 3.2 Deleting All Jobs on a Specific Printer To delete all jobs where the printer name matches: