Printer Deployment with powershell
Hello guys,
Trying to power script printer deployment.
So far I been able to get these two lines to work..
Add-Printer -Name "HP M401n" -DriverName "HP M401n" -PortName 10.121.31.80
Add-PrinterPort -Name 10.121.31.80 -PrinterHostAddress "10.121.31.80"
But I can't seem to get the Add-Printerdrivers command to work..
Here is the command and what I receive
PS C:\Windows\system32> Add-PrinterDriver -Name test -InfPath "C:\Users\Jay\Desktop\HPM401n\hpcm401u.inf"
Add-PrinterDriver : One or more specified parameters for this operation has an invalid value.
At line:1 char:1
+ Add-PrinterDriver -Name test -InfPath "C:\Users\Jay\Desktop\HPM401n\hpcm401u.inf ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (MSFT_PrinterDriver:ROOT/StandardCimv2/MSFT_PrinterDriver) [Add-Printer
Driver], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070057,Add-PrinterDriver
Trying to power script printer deployment.
So far I been able to get these two lines to work..
Add-Printer -Name "HP M401n" -DriverName "HP M401n" -PortName 10.121.31.80
Add-PrinterPort -Name 10.121.31.80 -PrinterHostAddress "10.121.31.80"
But I can't seem to get the Add-Printerdrivers command to work..
Here is the command and what I receive
PS C:\Windows\system32> Add-PrinterDriver -Name test -InfPath "C:\Users\Jay\Desktop\HPM401n\hpcm401u.inf"
Add-PrinterDriver : One or more specified parameters for this operation has an invalid value.
At line:1 char:1
+ Add-PrinterDriver -Name test -InfPath "C:\Users\Jay\Desktop\HPM401n\hpcm401u.inf ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (MSFT_PrinterDriver:ROOT/StandardCimv2/MSFT_PrinterDriver) [Add-Printer
Driver], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070057,Add-PrinterDriver
Comments
Overall, I will say that scripting full printer installation with drivers is enough of a pain to make GPP preferable, even for local TCP/IP printers. Scripting can still be useful in certain scenarios, but probably very few. If you are able to provide a print server cluster over a fast network connection, local TCP/IP printer connections are certainly not worth the effort over just using a print server.
Also, keep in mind that the printer cmdlets are only available in PowerShell 3.0 in Windows 8/Server 2012 and on, and you have to deploy PS 3.0, including dependencies, if you want to use them for Windows XP through 7 clients (pre-XP of course is not an option). I actually went to the trouble of essentially duplicating them with individual PowerShell scripts via WMI, but the Cmdlets are more robust than my scripts and still, as stated, probably not the direction you really want to go.
Complete: 55/120 credits SPAN 201, LIT 100, ETHS 200, AP Lang, MATH 120, WRIT 231, ICS 140, MATH 215, ECON 202, ECON 201, ICS 141, MATH 210, LING 111, ICS 240
In progress: CLEP US GOV,
Next up: MATH 211, ECON 352, ICS 340