Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Powershell/WMI

$
0
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

submitted by /u/_tufan_
[link] [comments]

The post Powershell/WMI appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793