This content originally appeared on David Walsh Blog and was authored by David Walsh
Automation is a system administrator, support agent, and tech savvy person’s dream. Automating tasks via scripts remotely helps to get clients out of trouble or even the organization itself. Oftentimes big updates can require users log out. Logging a user out from command line is super easy on Macs!
To log a user out of macOS with a confirmation warning, execute the following from command line:
osascript -e 'tell app "System Events" to log out'
To force log out of macOS without warning, execute the following from command line:
osascript -e 'tell application "loginwindow" to «event aevtrlgo»'
osascript is a really amazing utility, one that lets you change system volume, send iMessages, and identify app IDs. Readable automation commands? Priceless!
The post Log a User Out from Command Line appeared first on David Walsh Blog.
This content originally appeared on David Walsh Blog and was authored by David Walsh
David Walsh | Sciencx (2021-12-14T10:49:24+00:00) Log a User Out from Command Line. Retrieved from https://www.scien.cx/2021/12/14/log-a-user-out-from-command-line/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.