Hi all. I have an interesting thing I would like to do:
Change print settings on 5000 queue’s with a one-liner, ok perhaps two…
Here is what I can extract from the print settings from one of the queue’s :
$queue = “printerqueue_name”
[xml]$printTicket = Get-PrintConfiguration -PrinterName $queue | Select-Object -ExpandProperty PrintTicketXML
($printTicket.PrintTicket.ChildNodes | where name -Like psk:jobinputbin).LastChild.name = “ns0000:auto”
Set-PrintConfiguration -PrinterName $queue -PrintTicketXml $printTicket
The Idea behind this script is that I would like to change the inputbin from “ns0000:Cassette2” to “ns0000:Auto” - or whatever Cassette I would like to have for this queue.
But I get an error I think is quite generic :
Set-PrintConfiguration : Invalid at the top level of the document.
At line:6 char:1
- Set-PrintConfiguration -PrinterName $pname -PrintTicketXml $printTicket
+ CategoryInfo : InvalidArgument: (MSFT_PrinterConfiguration:ROOT/StandardCi...erConfiguration) [Set-PrintConfiguration], CimException + FullyQualifiedErrorId : HRESULT 0x80070057,Set-PrintConfiguration
It seems that it should be possible to edit the xml settings, and there is a lot of settings you can list out.
And if you change the Cassette setting in “advanced settings” on the queue, these changes are reflected immediately to the xml settings.
There are 2 different type of settings : PrintTicketXml and PrintCapabilitiesXml
Save the xml config to look at it in a browser :
Anyone with an Idea of how to do this?