Skip to content

Instantly share code, notes, and snippets.

@n8felton
Last active July 6, 2016 01:55
Show Gist options
  • Select an option

  • Save n8felton/ab5f0e7d9fbf82931a2f9cdad08432ab to your computer and use it in GitHub Desktop.

Select an option

Save n8felton/ab5f0e7d9fbf82931a2f9cdad08432ab to your computer and use it in GitHub Desktop.
Change system.preferences.printing authorization policy right to allow `staff` group
#!/bin/bash
# Read the current policy and save to a plist
/usr/bin/security \
authorizationdb \
read \
system.preferences.printing > "${TMPDIR}/system.preferences.printing.plist"
# Show the current policy saved to the plist
cat "${TMPDIR}/system.preferences.printing.plist" \
| plutil -convert xml1 -o - -
# Change the policy so that the group is now "staff"
defaults \
write \
"${TMPDIR}/system.preferences.printing.plist" \
group -string "staff"
# Verify the group change is in the plist
cat "${TMPDIR}/system.preferences.printing.plist" \
| plutil -convert xml1 -o - -
# Set the policy using the modified plist
sudo /usr/bin/security \
authorizationdb \
write \
system.preferences.printing < "${TMPDIR}/system.preferences.printing.plist"
# Verify the change was imported properly
/usr/bin/security \
authorizationdb \
read \
system.preferences.printing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment