Switching from a non-admin user to an admin user to run an app

administratorapplescripthigh sierrapermissionsudo

I've recently been faced with a challenge at the library I work at that I need to make a small bit of code in MacOS High Sierra that I can't figure out for the life of me! I have some experience coding in Windows but have never used Macs before and I was really hoping someone here could help me, as its really hard to learn what I need to do with no basic knowledge of AppleScript.

Here is what I need this code to do.

  1. Login into an admin user from a non-admin user at a certain time
  2. Run a script in the admin user account
  3. Script reboots into Windows using bootcamp

I know that I can handle the 'certain time' portion by using the calendar app to run the code that actually does the work, and to boot into windows using this code, but I have been trying for hours to figure out switching users when I know someone experienced could do it in less than 15 minutes. Any help would be extremely appreciated!!!

Best Answer

About the only thing you can do in 15 minutes is let the admin account be open to all the non-admin users and have unlocked your library macs to more admins.

Have a look at BootRunner which solves this problem for the entire lab. There is discount pricing and a free trial. Based on what you’re using to manage the lab - your MDM choice may dictate or handle this for you as well.