Setting up Mac OS X 10.5 and 10.6 to auto lauch programs for ALL users

Discussion in 'macOS' started by Sean123, Feb 5, 2011.

  1. Sean123 macrumors newbie

    Joined:
    Feb 5, 2011
    #1
    I need help auto launching a program for all users on a MAC. Im working with Active Directory so I dont know who will be logging in. I have a little program what after login it launchs showing my acceptable use policy and they have to click ok and it goes away. Can anyone help?
     
  2. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #2
    Just add it to the Login Items under each user account. Or make it your wallpaper.
     
  3. Sean123 thread starter macrumors newbie

    Joined:
    Feb 5, 2011
    #3
    Is there a way to set it at the root or system level so that it happens for every account?
     
  4. calderone macrumors 68040

    calderone

    Joined:
    Aug 28, 2009
    Location:
    Seattle
    #4
    Tough to do when you don't know who will be logging in, just as the OP said, since they are using AD.

    Also, why suggest a wallpaper when this is more than possible.

    OP, Launchd is your answer. Here is a sample plist:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>Label</key>
    	<string>com.company.usepolicy</string>
    	<key>LaunchOnlyOnce</key>
    	<true/>
    	<key>ProgramArguments</key>
    	<array>
    		<string>open</string>
    		<string>Path to my.app</string>
    	</array>
    	<key>RunAtLoad</key>
    	<true/>
    	<key>ServiceDescription</key>
    	<string>Launches acceptable use policy</string>
    </dict>
    </plist>
    
    You want to put this in /Library/LaunchAgents, and it will run for any user who logs in, AD user or not. You generally want to name it in reverse domain format for example: com.company.usepolicy.plist

    You could also point directly at the binary within.

    Hope that helps. You can find more about it here:
    http://developer.apple.com/library/.../Reference/ManPages/man5/launchd.plist.5.html
     
  5. Sean123 thread starter macrumors newbie

    Joined:
    Feb 5, 2011
    #5
    I already have a program or script that does this. Everything was fine until we went to the AD user names. it is located in /Library/Scripts/AUPAgree is ther a way to just launch AUPAgree at everyones login?
     
  6. calderone macrumors 68040

    calderone

    Joined:
    Aug 28, 2009
    Location:
    Seattle
    #6
    However you want to do it. If you want to point at an app or a script, it doesn't matter. All you need to do is change the plist to match what you want. You are still going to put in /Library/LaunchAgents.

    The plist is not a script, it is a manifest that launchd reads to determine what to run and how. It needs to be in that format and in that location.
     
  7. Sean123 thread starter macrumors newbie

    Joined:
    Feb 5, 2011
    #7


    ok I think Im starting to understand. Where in the code do I point to my program? /Library/Scripts/Program?
     

Share This Page