Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

CondorXIII

macrumors newbie
Original poster
Oct 28, 2011
7
0
Calgary, AB, Canada
Hey guys, does anyone know how to add an item to startup items for a user through terminal. That way I can script it and push it to people that I administer at work. Thanks in advance if anyone has an idea. My Linux command line is a bit dusty.
 

Detrius

macrumors 68000
Sep 10, 2008
1,623
19
Apex, NC
Sure, since you're administering multiple systems and need to push things out to them, I assume you're running OS X Server. Startup Items are one of the options in Workgroup Manager.

If you're managing multiple machines the hard way, check out login hooks.

http://support.apple.com/kb/HT2420
 

larkost

macrumors 6502a
Oct 13, 2007
534
1
WorkgoupManager is on eway of doing this (and the most sophisitcated), but there are other ways:

1) For person-by-person additions add it to ~/Library/com.apple.loginitems.plist. You could script adding this to that plist, but there are some diffuculties, namely that you need to get alias data, which is a pain in the neck. Note: copying it from one computer is not going to do what you want. The second difficulty (not as big a hurdle) is that you need to add this into the plist, and it is nested enough that you are not going to want to use the 'defaults' command, but rather need to use something more savy. I would use Python to do it.

2) You could add this to the system-wide /Library/Preferences/loginwindow.plist dictionary, specifically as a path item in the AutoLaunchedApplicationDictionary array. This would work, and is also a GUI launcher, but it would happen for every single user. Same general issues with the plist apply as before, but you skip the Alias part.

3) If this was a more command-line based thing, then you would want to use a launch-agent from /Library/LaunchAgents. Once you get the hang of the plist format, this is the best option for non-GUI things.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.