Posted on 09-28-2017 09:16 AM
Hi,
Is there anyway to set the OS to log off the user when the lid is closed on Sierra?
What I'm trying to accomplish is to run a script from JSS which triggers at the log off, however, 99% of the time users don't log off and just close the lid.
Any help is much appreciated.
Thank you in advance.
Posted on 09-28-2017 01:34 PM
You might want to be careful altering lid closure behaviour, it's generally set to sleep/hibernate the machine immediately and people usually follow this up by immediately putting it in a bag or other thermally enclosed space. The few times my machine has woken or not gone to sleep properly in my bag it has got so hot it's not a process I would want to repeat often!
Posted on 09-28-2017 05:49 PM
@javidmajdi Rather than try to run a script from your JSS, you'd be better off with a script you've installed locally on the user's machine that checks for the lid being closed with a user logged in, and are triggering periodically via a LaunchDaemon. See this article on StackExchange for some ideas:
https://apple.stackexchange.com/questions/104486/macbook-air-pro-run-script-upon-lid-close
Posted on 01-25-2019 09:45 AM
@javidmajdi Did you find a solution you liked for triggering a script when the lid closes? I have the same problem in my school. Kids close the lid instead of log off, and even those that do, never bother to click ok in the warning screen.