Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

I want to write a powershell script to clear specific printer queues from csv

$
0
0

This is what I have so far, but doesn't seem to be working. Any help would be appreciated.

$InCSVPath = "c:\printeraddscript\printerremove.csv"

$csv = Import-Csv $InCSVPath
foreach($item in $csv){     

       $server = $item.Server + ".Domain name here"  

       $printer = $item.Printer  

       $a = Get-WmiObject Win32_PrintJob -ComputerName $server -Filter "Name='$printer'" }

foreach ($job in $a)
    {   
   "Canceling job $($job.JobId)"   
}


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>