Setting Canon iR-ADV C5840 Color Property to B&W using Powershell (original) (raw)
Hi!
We’re looking to stage/install the Canon Generic Plus PCL6 driver and then connect one of our Canon iR-ADV C5840 network printers using a PowerShell script. In that process, we’re also setting some default printer configuration properties, including collate, duplexing mode, paper size, and namely…color. The whole process works just fine from start to finish, and we’re able to stage/install the driver successfully, connect the network printer using its IP address, and even set the default printer config using PowerShell. The only issue that we run into is getting the default color to be set to B&W. To give a better idea of the PowerShell command that sets the configuration, this is what we have…
try{
Set-PrintConfiguration -PrinterName <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>P</mi><mi>r</mi><mi>i</mi><mi>n</mi><mi>t</mi><mi>e</mi><mi>r</mi><mi>N</mi><mi>a</mi><mi>m</mi><mi>e</mi><mo stretchy="false">[</mo></mrow><annotation encoding="application/x-tex">PrinterName[</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mord mathnormal" style="margin-right:0.02778em;">r</span><span class="mord mathnormal">in</span><span class="mord mathnormal">t</span><span class="mord mathnormal" style="margin-right:0.02778em;">er</span><span class="mord mathnormal" style="margin-right:0.10903em;">N</span><span class="mord mathnormal">am</span><span class="mord mathnormal">e</span><span class="mopen">[</span></span></span></span>i] -Collate <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi><mi>r</mi><mi>u</mi><mi>e</mi><mo>−</mo><mi>D</mi><mi>u</mi><mi>p</mi><mi>l</mi><mi>e</mi><mi>x</mi><mi>i</mi><mi>n</mi><mi>g</mi><mi>M</mi><mi>o</mi><mi>d</mi><mi>e</mi><mi>O</mi><mi>n</mi><mi>e</mi><mi>S</mi><mi>i</mi><mi>d</mi><mi>e</mi><mi>d</mi><mo>−</mo><mi>P</mi><mi>a</mi><mi>p</mi><mi>e</mi><mi>r</mi><mi>S</mi><mi>i</mi><mi>z</mi><mi>e</mi><mi mathvariant="normal">"</mi><mi>A</mi><mn>4</mn><mi mathvariant="normal">"</mi><mo>−</mo><mi>C</mi><mi>o</mi><mi>l</mi><mi>o</mi><mi>r</mi></mrow><annotation encoding="application/x-tex">true -DuplexingMode OneSided -PaperSize "A4" -Color </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6984em;vertical-align:-0.0833em;"></span><span class="mord mathnormal">t</span><span class="mord mathnormal" style="margin-right:0.02778em;">r</span><span class="mord mathnormal">u</span><span class="mord mathnormal">e</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="mord mathnormal">u</span><span class="mord mathnormal" style="margin-right:0.01968em;">pl</span><span class="mord mathnormal">e</span><span class="mord mathnormal">x</span><span class="mord mathnormal">in</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord mathnormal" style="margin-right:0.10903em;">M</span><span class="mord mathnormal">o</span><span class="mord mathnormal">d</span><span class="mord mathnormal">e</span><span class="mord mathnormal" style="margin-right:0.02778em;">O</span><span class="mord mathnormal">n</span><span class="mord mathnormal">e</span><span class="mord mathnormal" style="margin-right:0.05764em;">S</span><span class="mord mathnormal">i</span><span class="mord mathnormal">d</span><span class="mord mathnormal">e</span><span class="mord mathnormal">d</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mord mathnormal">a</span><span class="mord mathnormal">p</span><span class="mord mathnormal" style="margin-right:0.02778em;">er</span><span class="mord mathnormal" style="margin-right:0.05764em;">S</span><span class="mord mathnormal">i</span><span class="mord mathnormal">ze</span><span class="mord">"</span><span class="mord mathnormal">A</span><span class="mord">4"</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="mord mathnormal">o</span><span class="mord mathnormal" style="margin-right:0.01968em;">l</span><span class="mord mathnormal" style="margin-right:0.02778em;">or</span></span></span></span>False
Write-LogEntry -Stamp -Value "Successfully set printer configuration to custom settings"
}
catch{
Write-LogEntry -Stamp -Value "Error setting printer configuration for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>P</mi><mi>r</mi><mi>i</mi><mi>n</mi><mi>t</mi><mi>e</mi><mi>r</mi><mi>N</mi><mi>a</mi><mi>m</mi><mi>e</mi><mo stretchy="false">[</mo></mrow><annotation encoding="application/x-tex">PrinterName[</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mord mathnormal" style="margin-right:0.02778em;">r</span><span class="mord mathnormal">in</span><span class="mord mathnormal">t</span><span class="mord mathnormal" style="margin-right:0.02778em;">er</span><span class="mord mathnormal" style="margin-right:0.10903em;">N</span><span class="mord mathnormal">am</span><span class="mord mathnormal">e</span><span class="mopen">[</span></span></span></span>i]"
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi><mi>h</mi><mi>r</mi><mi>o</mi><mi>w</mi><mi>B</mi><mi>a</mi><mi>d</mi><mo>=</mo></mrow><annotation encoding="application/x-tex">ThrowBad = </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">T</span><span class="mord mathnormal">h</span><span class="mord mathnormal">ro</span><span class="mord mathnormal" style="margin-right:0.05017em;">wB</span><span class="mord mathnormal">a</span><span class="mord mathnormal">d</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span></span></span></span>true
}
The Set-PrintConfiguration command executes just fine for all the properties, except the Color property. When looking in the printing preferences, the Color Mode defaults to “Auto [Color/B&W]” no matter if the color switch in PowerShell is set to TrueorTrue or TrueorFalse. See below…
Is there a way to get past this with setting the printer configuration, or is there a way to manipulate the driver installation to set the color as well? Any help is appreciated. Thanks.
If you were using a print server, you could go and make changes to the default/preferences tab and it would push out that way. But it reads like you’re just directly connected to the device without a server in the middle.
Check around Canon site as they may have a preflight program like HP does that allows you to create an custom install image for printers and preset anything you want . HP calls it PARK. (Printer Administrator Resource Kit)