SCCM has no built-in mechanism to handle printer driver installation and printer object creation. We can do the installation of the printer drivers in a few different ways as well as use some built-in Windows vbs scripts to create the printer objects. We will deploy the printers as "Applications".
The first example will show how to create an HP printer. HP has a Universal Print Driver that simplifies the process of creating printers. Creating a printer in SCCM can be done in same way you would create an application. Instead of using a "setup.exe" as the install program, we'll use a script to "install" the printer.
- First make a new folder on your Desktop or somewhere else local. You will need to put the printer driver folder in here that we're about to download, as well as a script file we'll create.
- Next, get a copy of the HP Universal Print Driver from their website: http://www8.hp.com/us/en/solutions/business-solutions/printingsolutions/upd.html. This will download a .exe zipped file containing the driver. Run the .exe file---when it asks you where to unzip the folder it contains, select the folder you created.
- The folder you created should now have the HP Universal Print Driver folder in it. Now, right-click in the empty space in that folder window. Create a new text file. Open it in notepad.
- Paste in the install script:
title Printer Installation starting...
echo Installing PRINTER NAME GOES HERE .....Please Wait..........
"upd-ps-x64-188.8.131.5226\install.exe" /q /n"PRINTER NAME CLIENTS SEE ON THEIR MACHINES GOES HERE" /smIP.ADDDRESS.OF.PRINTER.GOES.HERE
echo Printer Installation Completed.........
Note that you will need to edit the file to incorporate your specific printer's common name and IP address info.
The syntax for installing a printer using the Universal Printer Driver setup exe is as follows:
The syntax for deleting the printer would be:
All options for the Install.exe command are listed in a section at the bottom of this KB
- Save the file and close Notepad.
- Click the "View" tab at the top of the folder view window, and make sure "File Name Extensions" is checked. Right click the text file you created and rename it "upd.cmd" making sure to replace the .txt file extension.
- Now you need to copy the folder with our driver and script to the UNC path where your packages sources are located.
- Please then see the section below called Printer Detection Registry Key.
The second example demonstrates installing the inf printer driver using a vbscript that comes with Windows. The Printer Admin Scripts are located at %SystemRoot%\System32\Printing_Admin_Scripts\ on the system. You can copy the scripts to the source folder that already contains the printer drivers for ease of installation. These scripts are relatively small and this guarantees that the client machine will have the scripts.
- The install.cmd script contains:
REM Set the printer script variables
set PrinterModel="Xerox WorkCentre 7435"
set PrinterFriendlyName="IST Xerox Printer"
REM Create Port
cscript Prnport.vbs -a -r IP_%FQDN% -h %FQDN% -o raw -n 9100
REM Install Driver
cscript Prndrvr.vbs -a -m %PrinterModel% -i %~dp0%DriverPath%
REM Create Printer
cscript prnmngr.vbs -a -p %PrinterFriendlyName% -m %PrinterModel% -r IP_%FQDN%
- How do we find out what model name to use in the following command? In this example we choose Xerox WorkCentre 7835 PS. You can typically find this directly in the inf file. Right click the inf file and choose to open it with a text editor.
- We're accomplished 3 major things with this script.
- Create a port.
- Install the printer driver.
- Create the printer.
- Again, the syntax for deleting the printer would be:
- Please see the note below for how to set the printer detection method.
For both printer installation methods, you'll also need to create detection method for the application to determine if the printer is already installed. You can do this by adding a registry key detection in the Detection Method tab of the Deployment Type. The key should follow the format of SYSTEM\CurrentControlSet\Control\Print\Printers\PrinterName.
For those using the printer deployment method in example 2, you'll need to take some additional steps if you are deploying printers to non-admin users. A few settings need to be added to the GPO in order to allow non-admins to install printer drivers, otherwise the printer install scripts will fail. All computers under the Endpoints OU already have this setting enabled.
- In Group Policy Management Editor go to Computer Configuration > Policies > Administrative Templates > System > Driver Installation. Edit Allow non-administrators to install drivers for these device setup classes setting.
- Enable policy setting and click Show… to specify device types that users will be able to install.
- Add following device classes:
You can create a printer in the same manner that you can create an application. As mentioned earlier use the install script as the install program and use PrintUI.exe for the uninstall program. To deploy your newly created printer, follow the documentation here: SCCM Create a Deployment
This lists all options as pulled from the "Install.exe" executable from the HP Universal Print Driver: