我正在尝试暂停2003打印服务器上的所有队列,以及适用于2008R2和2012R2服务器的以下内容在2003打印服务器上不起作用。是否有可以在2003服务器上使用的等效WMI调用?
$strComputer = "test" Get-WmiObject win32printer -ComputerName $strComputer | % {$null = $.pause()}
这是我得到的错误:
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