Printer settings and network accounts

MrBingham917
New Contributor II

Hello everyone- Long story short- New copier deployed to my campus, technician says we need to set up printer presets so it doesn't add to our color printing pool. I have captured the settings from a composer capture, but I can't get it to apply to more than our local admin account. The workroom around the copier has multiple network users printing to it.

Anyone have any ideas?

Thanks Robert.

8 REPLIES 8

thomasC
Contributor

Is it a PKG or did you make a DMG Package? If DMG Package you could set it to FUT and FEU. Did you use the Add Printers feature in Casper Admin?

MrBingham917
New Contributor II

It's a DMG file that I have, and I do have it set for FUT and FEU, but it only applies to my one local user. When I try to log in as a network user, the settings don't copy over. *edit* I was using the add printer feature in Admin to add the printer.

talkingmoose
Moderator
Moderator

This is a flaw (in my opinion) about how Casper handles FEU.

FEU worked until Casper 5 or 6 when JAMF changed its methodology to locate user home folders. It now uses dscl. By using dscl they no longer recognize locally stored home folders created by an external directory service. dscl only recognizes local users and the currently logged in directory user.

I've raised this issue a few times with JAMF and they don't seem to be willing to change this behavior or maybe it's not a high enough priority for them.

To work around this I have a template .pkg in Composer that includes a postflight script to ditto files into the user template folder and recursively ditto files to each user folder in /Users, excluding Shared.

donmontalvo
Esteemed Contributor III

@talkingmoose Yep, that's our approach too. Tom and Steve helped us create one that's fairly short and hasn't hiccupped since we started using it. Hmmm...but I wonder if it could be made shorter? Is there a "Mine is shorter than yours" script thread? If not we should startone. Looping scripts are definitely a life saver for us.

--
https://donmontalvo.com

MrBingham917
New Contributor II

@talkingmoose - I am still a little in the dark as to what you're referring to in composer. I, unfortunately am still very green in terms of scripting, and have only used Composer as capturing or dragging mpkg/pgk files into there. Do you have an example of how I could get that started, or point me to some sort of documentation for that?

Thanks again.

acdesigntech
Contributor II

In Composer, each .pkg that you create (Located under SOURCES) has a scripts option underneath it (you have to click the disclosure triangle). From there, right click on the Scripts > add shell script, then select postflight (I'm assuming postflight here since you are looking to add files/setting to existing users).

You'll see postflight show up under scripts, and then you can write your script within composer.

I have several packages that dump user settings to a central location, and scripts that run as postflights to these packages to populate user templates and existing users. I'd imagine that you'd have to have something like this:

#!/bin/sh
## postflight

pathToScript=$0
pathToPackage=$1
targetLocation=$2
targetVolume=$3

## Sync to existing users
for PREF_ITEM in /Applications/Utilities/ISD/Installs/User Settings/; do for USER_HOME in /Users/; do USER_ID=basename "${USER_HOME}" if [ "${USER_ID}" != "Shared" ]; then rsync -avE "${PREF_ITEM}" ${USER_HOME} chown $USER_ID "${PREF_ITEM}" chmod 700 "${PREF_ITEM}" fi done

## Sync to user template rsync -avE "${PREF_ITEM}" /System/Library/User Template/English.lproj/ chown root "${PREF_ITEM}" chmod 700 "${PREF_ITEM}"
done

exit 0 ## Success
#exit 1 ## Failure

(my package dumps to /App/Util/ISD/Installs/User Settings/)

This postflight is untested so there might be typos et al.

talkingmoose
Moderator
Moderator

Do you subscribe to MacTech magazine or can you get a hold of the July 2011 edition? I have an article there that goes into detail about adding scripts to packages.

DMG packages are "dumb". PKG packages are "smart". Both can deploy files to a computer but only PKG packages can run scripts that let you do more things such as deleting files or copying files recursively to every user folder.

A basic script to delete a file and a folder would look like:

#!/bin/sh

rm /path/to/file.txt
rm -R /path/to/folder/

exit 0

In Composer you'd select your package in the left pane and twiddle open the disclosure triangle. Right-click the Scripts folder and select Add Shell Script --> postflight. Paste the above script into the editor window on the right, save and create a .pkg file.

When you deploy your .pkg file the script will run after (post) installing your files.

If you're unfamiliar with scripting then I encourage you to look into either AppleScript or Shell scripting going forward. Learning some basics about one or both will really take your administration capabilities to the next level.

This isn't related to Flash but I do have a page about how to script the removal of Microsoft Office for Mac 2011. You may find its examples helpful:

http://www.officeformachelp.com/office/install/remove-office/

MrBingham917
New Contributor II

@moose @acd thanks guys. This is very helpful!