Windows allows you to create a printer pool, which is a printer with two or more print devices (that is, printer ports) available. Windows sends a given print job to any of the printers in the pool. This feature is useful in environments where users do a lot of printing and need the speed that additional printers can provide, without having to ask the user to choose a specific print device to use.
There are no PowerShell cmdlets to enable you to create a printer pool. Also, WMI does not provide a mechanism to create a printer pool. As with other recipes in this chapter, you make use of PrintUI.DLL
and RunDLL32
to deploy a printer pool. This is another example of utilizing older console applications to achieve your objective.
Run this recipe on the PSRV print server. This recipe uses the printer and port you created in the Installing and sharing printers recipe.
SalesPrinter1
printer:$P = 'SalesPP2' # new port name Add-PrinterPort -Name $P -PrinterHostAddress 10.10.10.62
SalesPrinter1
:$P1='SalesPP' $P2='SalesPP2' rundll32.exe printui.dll,PrintUIEntry /Xs /n $p Portname $P1,$P2
$P = 'SalesPrinter1' Get-Printer $P | Format-Table -Property Name, Type, DriverName, PortName
In step 1, you added a new printer port (SalesPP2
) to serve as a second printer port for the SalesPrinter1
printer. In step 2, you set the two printer ports for SalesPrinter1
, thus creating the printer pool. These steps produced no output.
In step 3, you can see the result of the first two steps. Notice that the SalesPrinter1
printer now has two available printer ports, as can be seen here:
3.17.68.14