Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Work around some bugs with managed printers OS X Server
Managed printers (on managed clients) are convenient, but there are bugs. The problem is the system doesn't clean up after itself. One side effect is the user has old printer configurations that were deleted from the server (this can also result in what appears as duplicate printers, but the config was updated with the same name, or deleted and recreated). Another side effect is with computer list managed printers. For example, computer lab A has printer A managed only. Computer lab B has printer B managed only. The user logs into lab A, logs out, then logs into lab B. They shouldn't see the lab A printer at this point, but they do (because they logged into lab A once upon a time, and this saved in their home folder).

Read the rest for some workarounds to these problems...

First, download these scripts. Put Login.sh and Logout.sh in a place where a non-admin user can't read them (admin doesn't need read access either; I use /private/var/root/Documents/). Use LoginWindow Manager to set these files as login and logout scripts.

Put DeleteUserPrinters.app in /Library/Scripts/Printing Scripts, and make it a login item for your workgroup. Use Dockless to make the AppleScript app invisible to the user (so it doesn't appear in Dock).

Use Apple Remote Desktop to copy out the three scripts and /private -> var -> root -> Library -> Preferences -> com.apple.loginwindow.plist to all of your clients (to enable login and logout script config). Either open ARD with Pseudo to copy out the plist, or enable root then open ARD.

That's it, you should be all set. Please share your results via a comment here or email (click my username for an email link).
    •    
  • Currently 1.75 / 5
  You rated: 2 / 5 (8 votes cast)
 
[10,478 views]  

Work around some bugs with managed printers | 4 comments | Create New Account
Click here to return to the 'Work around some bugs with managed printers' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Work around some bugs with managed printers
Authored by: ocdinsomniac on Sep 29, '06 09:57:58AM

I've had this problem too, and it's annoying as hell. Thanks for this hint!

One question: Why are you using a separate Apple Script to clean out the home folders? You could just use a shell script as a login hook, or add it to your existing login hook, and that would simplify things a lot (no Dockless hack necessary, one less script). My guess for your reasoning is that you need this script to be user-specific in order to clean out files in the user's home account. Wanted to let you know, though, that you can specify the current user in login scripts by indicating them as $1. So, in your login script, anywhere you want to specify the current user, you just put $1, like so:

rm -drf ~$1/Library/Preferences/ByHost/com.apple.print.*

Don't know if you already knew this and there's some other reason for the Apple Script that I'm missing. But if you didn't, now you do. Hope that's helpful for you, 'cause I think this hint will be helpful for me.

Thanks a lot!

-systemsboy



[ Reply to This | # ]
Work around some bugs with managed printers
Authored by: jelockwood on Sep 29, '06 09:58:28AM

The whole aspect of managed printers in Mac OS X server is a disaster, and if anything Tiger server is worse at this than Panther server.

First to address your hint. If you do this, yes you will clean up the list of printers, but the process of deleting the printer also deletes any settings associated with that printer such as defining additional paper trays, memory, and duplex capabilities. If you subsequently print to that printer (when it is re-created by a different user) it will not let you access the extra capabilities and the "Auto" choice for paper tray will then default to the wrong paper tray.

Second, with Tiger server it is completely and utterly impossible to use managed preferences to add a print queue that points to a Mac OS X Tiger server spool queue. You can only add a managed preference pointing DIRECTLY to the printer (or possibly also a printer shared from a client machine). With Panther server this was possible.

Also with Tiger server, even though I have set (via managed preferences) a default printer, some users find that randomly a different one will become the default printer and then randomly revert back (it always goes to the same wrong one per user but not the same for ALL users). For example, my default is set to the IT Department printer, but sometimes BY ITSELF it will switch to defaulting to the Finance department printer.

The only improvement that Tiger server offers, is that it fixed the fact that although managed preferences in Panther server had a tick box to let users add local printers [and it would let you add them] IT WOULD NOT LET YOU USE THEM! (Unless your account had Administrator priviledges.) As I said this at least is fixed with Tiger server and client.

Finally for both Panther and Tiger, if you have printers setup by managed preferences and are using a mobile account (say on a laptop) and you bind to Open Directory by finding it via DHCP, then when out of the office (and unable to access the Open Directory) all (managed) printers will disappear from the printer menu (but not Printer Setup Utility). This you might think is no real issue since when off site you will not be able to access the printers anyway. Unfortunately Word and Excel when you open documents always try accessing the print driver (whether you want to or not) and find they cannot. Rather than catching the error gracefully they completely crash PREVENTING YOU OPENING AND USING ANY DOCUMENTS. Typical shoddy Microsoft (TextEdit for example does handle this gracefully). The workaround (as suggested by Apple) is to set Directory Access to not use DHCP to find the Open Directory server and instead set it to a manual entry.



[ Reply to This | # ]
Work around some bugs with managed printers
Authored by: bdog on Oct 25, '06 07:26:41PM

ocdinsomniac,
Yea, exactly the reason why I have an AppleScript. I think I tried $1, and since the log in/out scripts run as root, it touches root's home folder.

jelockwood,
1. You wont lose specific settings on the printers, since managed printers sets this for the users.

2. No, you can point clients to the print server. Setup the queues on the server. Then, sit at a client and add the queues by hand. Then, manage these printer configs you just setup on a client. And speaking of the print server, it doesn't square the number of copies anymore, yay!

3. Default printers finally work, I think. It seems to be remembering the last used printer, or the default set in the OD.

4. Yes, I confirm local printers are working on tiger.

5. We manually config LDAP, so can't verify that issue. Oh, and mobile accounts have many many issues of their own!



[ Reply to This | # ]
Work around some bugs with managed printers
Authored by: bdog on Oct 25, '06 07:29:06PM

Oh, forgot one very important thing. I think Apple finally fixed these issues in 10.4.7 (10.4.6?) because this year I haven't had to implement these scripts.



[ Reply to This | # ]