Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
Last active March 11, 2022 04:07
Show Gist options
  • Save talkingmoose/c994139378083fea610affeca3c3f90c to your computer and use it in GitHub Desktop.
Save talkingmoose/c994139378083fea610affeca3c3f90c to your computer and use it in GitHub Desktop.
Add this script to Jamf Pro and then assign to a policy. Fill in the printer details for the script parameters 4-9.
#!/bin/sh
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Written by: William Smith
# Professional Services Engineer
# JAMF Software
# [email protected]
# https://gist.github.com/c994139378083fea610affeca3c3f90c
#
# Originally posted: September 9, 2016
# Last updated: September 9, 2016
#
# Purpose: This is a generic script to create a printer with options
# using a policy in a Casper JSS.
#
# Except where otherwise noted, this work is licensed under
# http://creativecommons.org/licenses/by/4.0/
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# INSTRUCTIONS
# 1) Create a new Script in the JSS and paste the contents of the script into it.
# 2) Under the Options tab of the script, add the parameter labels as shown below.
# 3) Make a new policy and add the script.
# 4) Enter the correct settings for each parameter for the script to the policy.
# $4 = Printer Host Name
# $5 = Printer Location
# $6 = Printer Name
# $7 = Printer URL
# $8 = Printer PPD
# $9 = Printer Options
# create printer
lpadmin -p "$4" -L "$5" -D "$6" -E -v "$7" -P "$8" "$9"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment