September 4, 2015 at 6:07 am #29368
I am fairly new with PowerShell so I am asking for your patience.
My department is looking for a way to Display/Modify a specific printer option on their print servers using PowerShell commands.
The option we are looking to change is the Color Mode. (weather the printer is set to print in B&W or Color by default)
We would like to know if there is a class that exists to do this?
I have been playing around with the command;
$PrtConfig = Get-WmiObject Win32_PrinterConfiguration -computername $env:COMPUTERNAME"
then looking at its classes and have not been able to find the Color Mode.
>$PrtConfig.Color >2 -------> Lexmark 4404C >1 -------> Fax >$PrtConfig.Print Quality >1200 -------> Lexmark 4404C >600 -------> Fax
We have looked at "Color" and "PrintQuality" as specified in the Syntax from the MSDN site (https://msdn.microsoft.com/en-us/library/aa394364(v=vs.85).aspx) but have not found how to display weather or not the printer's default is set to print in B&W or Color. The Color class tells you if the device can print in color, not if it is set to print in color. [ex. a fax machine Color=1 (No color), Lexmark 4404C Color=2 (Color printing available)]
Once this cmdlet is found, we would be able to use the same/similar command to either set all the print devices to the same Mode or simply display its current setting.
Thank you in advance for all your help!
September 4, 2015 at 6:16 am #29369
Unfortunately, printer drivers are provided by their manufacturers, not by Microsoft. While there's a very loose standard as to certain information drivers must surface to the OS (mainly capabilities), it's up to the vendors to decide if they'll make it possible to change the driver settings from the command-line. Many, if not most, haven't done so. There isn't an actual global specification for them to adhere to, even. You may even need to start by contacting the manufacturers' support departments and posing the question to them.
All that said, Microsoft has done a bit of work to make *some* settings available. Look at https://technet.microsoft.com/en-us/%5Clibrary/Hh918361(v=WPS.630).aspx (which uses WMI under the hood). You might also look at http://blogs.technet.com/b/print/archive/2009/10/16/printer-management-using-powershell.aspx, which comes at the problem from a different approach. You might not be able to do everything you're after, but perhaps it'll be a starting point.
September 4, 2015 at 6:24 am #29370
Would I need to import a Print Management module to have access to these cmdlets?
... available on the MS site?
September 4, 2015 at 6:33 am #29372
The module should come with versions of Windows where it's supported, or be installed as part of the RSAT. And no, you shouldn't need to explicitly import it. But as I said, it likely uses WMI under the hood, meaning you don't necessarily need the module at all. You may need to just get on a machine that does have the module (I'm guessing Win8 and later, although I'm not sure if this module is in the RSAT or the base OS), and look at the command's definition to see what WMI class it's playing with.
September 4, 2015 at 6:35 am #29374
Based on https://technet.microsoft.com/en-us/library/hh918357(v=wps.630).aspx, I'm guessing it's Win8 and better. It's a CIM cmdlet, so it should be able to target any print server running PowerShell v3 and later with WsMan enabled. Potentially older machines via a DCOM session, although I don't have the ability to test that theory.
September 4, 2015 at 6:38 am #29375
Marc, the set-printconfiguration cmdlet in the first link Don posted was made available in Windows Server 2012 and Windows 8. If you are running one of these OSs or newer then you have access to the cmdlet. If you are not, you will have to upgrade to get access to it.
You must be logged in to reply to this topic.