I was curious the other day on what the command is in terminal to install a printer on a Mac since some of my customers don't give admin rights to their end users to change printer settings. 

Here is an example of installing a Dell 1765nfw printer to a Mac running Yosemite. 


  1. Grab the driver from the manufacturer. You will need the .ppd.gz file format of the driver. 
    1. Example: Dell C1765nfw Color MFP.ppd.gz
    2. I pulled this driver from /Library/Printers/PPDs/Contents/Resources/ on a Mac that already had the printer installed


  1. Create a new Online Kscript
  2. For Operating System, uncheck Select Specific Operating System and select Mac OSX
  3. Under Dependencies, upload your printer driver ppd.gz file
    1. rKLMee.png
  4. Add a New Task
  5. First step is copying the driver to the Printer PPD directory. 
  6. Under On Success - Launch  Program:
    1.  5pvfb0.png
    2. Directory: /bin/
    3. File: cp
    4. Parmeters: /Library/Application\ Support/Dell/KACE/data/kbots_cache/packages/kbots/130/Dell\ C1765nfw\ Color\ MFP.ppd.gz /Library/Printers/PPDs/Contents/Resources/
      1. *Change the number 130 to the ID of your script that gets made. (hover your mouse over the name of the script from the script list)
    5. Add another step underneath this one
    6. 7f8JZo.png
    7. Directory: /usr/sbin
    8. File: lpadmin
    9. Parameters-p Dell_C1765nfw_Color_MFP -L "Bruce's Office" -E -v lpd:// -P "/Library/Printers/PPDs/Contents/Resources/Dell C1765nfw Color MFP.ppd.gz" -u allow:all
      1. Change the IP address to the IP of the printer. 
      2. -L is the location (Bruce's Office) which you can change in the command
      3. -u allow:all allows all  users to see and change the printer settings

Test and run the script to ensure it installs. It should pop right up in the Printers list even if you have it opened. 

Removing a printer

This is an example of removing a specific printer. 

  1. Create a new Online Kscript
  2. For Operating System, uncheck Select Specific Operating System and select Mac OSX
  3. Add a New Task
  4. Under On Success - Launch  Program:
    1. VOdidv.png
    2. Directory/usr/sbin/
    3. File: lpadmin
    4. Parameters-x Dell_C1765nfw_Color_MFP
  5. If you need to get the name of the printer, you can just grab it from the Inventory of that Mac and replace it in the command above (minus the :idle part. That's the current status of the printer)
    1. OT4mZr.png