Category filter

Script to enable Guest User on Mac

Guest User on macOS devices provides a way for unauthorized users to use your device without handing them access to your private data and digital workspace. To configure the guest user account on a Mac, users have to manually enable the Guest User option under System Preferences. With Hexnode UEM, you can remotely enable the Guest User option by executing a simple Bash command using the Execute Custom Script action.

Scripting Language – Bash

File extension – .sh


The Sample Scripts provided below are adapted from third-party Open-Source sites.

Enable Guest User Account

  • The defaults command allows you to view and modify the settings used by applications and macOS.
  • The GuestEnabled key in /Library/Preferences/ accepts a Boolean value.
  • To turn off the Guest User option, replace TRUE with FALSE.

  • The above Bash script works only on macOS devices where Guest User account is already configured.
  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository