6 Replies Latest reply: May 10, 2012 7:44 AM by softwater
d@v3 Level 1 Level 1 (0 points)

Hi, can anybody help me with an logout script under 10.7.3 client

 

When I startup and login with an local standard user account I imediatley need to logoff and go back to the loginscreen.....we need this in case of using Filevault2 and AD Networkaccounts?

 

Kind regards

 

Dave


Mac OS X (10.7.3)
  • Topher Kessler Level 6 Level 6 (9,675 points)

    Are you asking how to make the system immediately log out once logged in to a specific account, or are you experiencing this problem and wish to make it stop?

  • d@v3 Level 1 Level 1 (0 points)

    Yes.....when i'am logged in to specific local useraccount in need to logoff immediately so i get the loginscreen with the login window as: Name and password' field so my AD users can login with their networkaccount.

     

    I'am not into the apple scripting so need some help and think its no problem for the Apple specialist on this discussionform!

     

    Thanks in advance!

     

    Dave

  • softwater Level 5 Level 5 (5,370 points)

    In other words you just want to log in order to unencrypt the disk, is that right?

     

    Good security move! I'm not sure I know how to do that off the top of my head, but I'll figure it out it if no one else comes along because such a script would be a very useful piece of work.

  • Topher Kessler Level 6 Level 6 (9,675 points)

    The terminal command to use would be the following:

     

    osascript -e 'tell application \"System Events\" to log out'

     

    The AppleScript line to use would be this:

     

    tell application "System Events" to log out

     

    These can be put into a login hook script (http://support.apple.com/kb/HT2420) or can be put into an AppleScript application (which can be created with the Automator utility), which then can be placed in the user's login items so it runs at login.

     

    The problem here is overcoming Apple's warning about automatically resuming your workflow, which appears at every logout.

  • d@v3 Level 1 Level 1 (0 points)

    Yes....our company wants to use Filevault2 but the pre-boot loginscreen form the Recovery Partition has only the possibilty to a list of users at the loginscreen....So next to the localadmin that's enabled for Filevault i want a second "standard" user with parantel controle and simple finder....when this user is loggin in I want the script to run the logoff action an then we have the normal login screen with name and password field so AD users can login.

     

    Thanks in advance!

     

    Dave

  • softwater Level 5 Level 5 (5,370 points)

    I haven't tested it, but this looks like it should do the trick if you write it as a Bash shell script and put it in your 'Login Items'. See if you can set that 'sleep' variable to 0 to get it to log out instantly.

     

    http://superuser.com/questions/40061/what-is-the-mac-os-x-terminal-command-to-lo g-out-the-current-user