Printers, Powershell And Wmi?
Tried to run in the Powershell console:
Set-WMIInstance -class Win32_Printer -argument @{Published=0}
And received the following error:
Set-WmiInstance : Invalid parameter
At line:1 char:16
+ Set-WMIInstance <<<< -class Win32_Printer -argument @{Published=0}
+ CategoryInfo : InvalidOperation: (:) [Set-WmiInstance], ManagementException
+ FullyQualifiedErrorId : SetWMIManagementException,Microsoft.Powe
I have used Set-WMIInstance to change other values in other classes without an issue, but for some reason it's not working with win32_printer. I have around 2500 printer queues to change so I hope someone can let me know where I'm going wrong.
I have used without an issue, however I would just like to know what I can't use Set-WMIInstance:
$a = gwmi win32_printer -filter "Name = 'PrinterName'"
$a.published=1
$a.put()
Thanks guys :)

(1 votes, average: 4.00 out of 5, rated)