0

I am trying to pause all queues on a 2003 print server and the following which works on a 2008R2 and 2012R2 server does not work on the 2003 print server. Is there an equivalent WMI call that I can use on the 2003 server?

$strComputer = "test" Get-WmiObject win32printer -ComputerName $strComputer | % {$null = $.pause()}

This is the error I get:

Get-WmiObject : Generic failure At line:1 char:1 + Get-WmiObject win32printer -ComputerName $strComputer | % {$null = $.pause()} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 
CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException + FullyQualifiedErrorId : 
GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
Micky Balladelli
  • 9,781
  • 2
  • 33
  • 31
John Balan
  • 43
  • 8
  • 1
    try with `$_.pause()` – Micky Balladelli Jun 14 '17 at 16:54
  • That did not work either. Even getting a list of printers works on 2008r2/2012r2 but not on the 2003 r2 server: $printserver = "stest" Get-WMIObject -class Win32_Printer -computer $printserver | Select Name,DriverName,PortName | Export-CSV -path 'E:\printers.csv' – John Balan Jun 14 '17 at 17:09
  • 1
    Ah yes, it's actually the Get-WmiObject that has an issue (the pause issue would have come later)...try with Get-WmiObject win32_printer – Micky Balladelli Jun 14 '17 at 17:16
  • It was the spooler service. Once i restarted it, everything worked. Thanks! – John Balan Jun 14 '17 at 19:04

0 Answers0