Powershell | Cleanup all the printer spooler queues

$computers = @(“COMP01″,”COMP02”) foreach ($computer in $computers) { echo $computer if (Test-Connection -BufferSize 32 -Count 1 -ComputerName $computer -Quiet) { echo “ON” #Get-WmiObject -computer $computers Win32_Service -Filter “Name=’Spooler'”| ft systemname, name, state #set your first argument as $computer #$computer = $args[0] #Stop the service: Get-WmiObject -Class Win32_Service -Filter ‘name=”spooler”‘ -ComputerName $computer | Invoke-WmiMethod -Name StopService […]