Access Keys:
Skip to content (Access Key - 0)

MECM - SCCM - Printer Deployment

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".

Example 1 - HP Universal Print Driver

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.

  1. 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.
  2. 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.
  3. 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.
  4. Paste in the install script:

    @echo off 
    title Printer Installation starting...
    echo. 
    echo Installing PRINTER NAME GOES HERE .....Please Wait..........
    "upd-ps-x64-5.9.0.18326\install.exe" /q /n"PRINTER NAME CLIENTS SEE ON THEIR MACHINES GOES HERE" /smIP.ADDDRESS.OF.PRINTER.GOES.HERE
    echo. 
    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:

    "install.exe" /q /h /n"User Friendly Printer Name" /smIPaddressOfPrinter

    The syntax for deleting the printer would be:

    PrintUI.exe /dl /n "User Friendly Printer Name" /q


    Install.exe /?
    All options for the Install.exe command are listed in a section at the bottom of this KB


  5. Save the file and close Notepad.
  6. 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.
  7. Now you need to copy the folder with our driver and script to the UNC path where your packages sources are located.
  8. Please then see the section below called Printer Detection Registry Key.

Example 2 - Printer Admin Script (non-HP Printers)

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:

    @ECHO OFF
    REM Set the printer script variables
    set FQDN=XrX-3.MIT.EDU
    set DriverPath=Drivers\x2GOAKL.inf
    set PrinterModel="Xerox WorkCentre 7835 PS"
    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%
    EXIT


  • 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.

    cscript Prndrvr.vbs -a -m "Xerox WorkCentre 7835 PS" -i %~dp0Drivers\x2DSPYP.inf


  • We're accomplished 3 major things with this script.
    1. Create a port.
    2. Install the printer driver.
    3. Create the printer.
  • Again, the syntax for deleting the printer would be:

    PrintUI.exe /dl /n "User Friendly Printer Name" /q

  • Please see the note below for how to set the printer detection method.

Printer Detection Registry Key

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.

Additional Notes

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.

  1. 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.

  2. Enable policy setting and click Show… to specify device types that users will be able to install.

  3. Add following device classes:
    4d36e979-e325-11ce-bfc1-08002be10318
    4658ee7e-f050-11d1-b6bd-00c04fa372a7 

Summary

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

HP UPD Options

This lists all options as pulled from the "Install.exe" executable from the HP Universal Print Driver:

===============================================================================================
|| BEGIN INSTALL.EXE /? ||
===============================================================================================

Installer Operation

/aml<"Name","Path"> Adds a Managed List Name using the specified URL or UNC path

/dgst - Disables the HP UPD Services tab for all print queues

/dm Installs the HP UPD in Dynamic Mode

/gcfm"<cfm file>" Specifies DCU configuration file to be utilized for new printer installations

/gcomname"<snmp community name>" Specifies a system global SNMP community name.
     The community name cannot end with a number

/h Hides the installer window

/infremove Remove all versions of HP Universal Printing Driver from the Windows driver store.
     The /q and /h switches are required. No other switches are supported with /infremove

/infstage Stage driver files to Windows driver store for printer plug and play software first
     installation. The /q and /h switches are required. No other switches are supported with /infstage

/m - driver version name need not be specified while installing. The /sm switch is required. Cannot
     be used with /sm\server\printer.

/n"<Printer Name>" Uses the specified name as the name of the printer

/nd Does not set the printer as the default

/ni Does not perform the printer installation, only processes other install options

/npf Don't open the Printers folder on completion

/q Quiet mode, no prompts

/qcomname"<snmp community name>" Creates a queue-specific SNMP community name. The community name
     cannot end with a number

/s<\virtualspooler> Specifies a cluster virtual server where the queue is to be installed.  Must be
     run from a physical node with administrative privileges

/sc Simple confirmation

/sm<Port> Creates a traditional mode printer bound to the specified <Port>. Local ports require ALL
     CAPS and a ':'

/tm Installs the printer in Traditional Mode

/u Use the existing printer driver if it's already installed

===============================================================================================

Examples:

install.exe /dm /npf /h /aml"LaserJet Printers","http://printserver/printerlist.asp"

install.exe /gcfm"c:\temp\duplex.cfm"

install.exe /h /nd

install.exe /infstage /h /q

install.exe /n"HP Color LaserJet Enterprise M750"

install.exe /ni /aml"Accounting OfficeJet Printers","\\printserver\hpoj.xml"

install.exe /ru /npf /h

install.exe /ru /npf /h /aml" LaserJets","http://printserver/userlist.asp"

install.exe /s"
\\
PrintServer1" /tm /n"HP LaserJet Enterprise flow M830 MFP"

install.exe /sc /npf /h

install.exe /sc /npf /h /n"HP Officejet Enterprise Color Flow MFP X585"

install.exe /smhostname /n"Radiology LaserJet"

install.exe /sm192.168.1.111 /n"HP LaserJet MFP M725"

install.exe /sm\\server\M880 /n"HP Color LaserJet flow MFP M880"

install.exe /smLPT1: /n"test printer"

===============================================================================================

Policy switches for use with AD template or MPA

/dmpa - Disables MPA functionality for the current user.

/empa - Enables the MPA functionality for the current user. Default MPA functionality will be
     retrieved from managed-print.

/gempa - Enables the MPA functionality for all users.

/gpolicy - Specifies the HP MPA Policy URL for all users.

/mppqs - Used to specify additional MPA http query string parameters. Rarely used because the
     /policy option allows for full URL specification including URI parameters.

/policy - Enables HP MPA policy checking for all users using current policy settings

/pqdads - Disables ADS support only for the current print queue.

/pqdmpa - Disables MPA support only for the current printer being installed. This allows a specific
     queue to be excluded from MPA policy management.

/ru Restricted user mode, only display HP Managed Printer Lists

===============================================================================================

For more information, please see the System Administrator's guide at [http://www.hp.com/go/upd]

===============================================================================================

See Also

IS&T Contributions

Documentation and information provided by IS&T staff members


Last Modified:

March 18, 2024

Get Help

Request help
from the Help Desk
Report a security incident
to the Security Team
Labels:
sccm sccm Delete
endpoint endpoint Delete
management management Delete
printer printer Delete
deployment deployment Delete
printers printers Delete
c-sccm c-sccm Delete
add add Delete
mecm mecm Delete
c-mecm c-mecm Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
Feedback
This product/service is:
Easy to use
Average
Difficult to use

This article is:
Helpful
Inaccurate
Obsolete
Adaptavist Theme Builder (4.2.3) Powered by Atlassian Confluence 3.5.13, the Enterprise Wiki