Category filter

Script to Create Sharing Only User Account on Mac

Organizations may need to share files and folders on devices with other users remotely, but they may want to restrict access to the device settings. Enterprises can set up sharing only user accounts on devices to accomplish this. However, creating an account manually on each device is a tedious task. Hexnode allows you to create sharing only user accounts remotely on macOS devices by executing custom scripts.

Scripting Language – Bash

File extension – .sh


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

Create a sharing-only user account

You can deploy the script given below to create a sharing-only user account on macOS devices. The script also allows you to customize the account by adding display names, profile pictures, and so on.


  • While writing the username, use a backslash \ before inserting space to prevent the shell interpreter from interpreting space as a separator and assuming two words as different arguments. E.g., for displaying Sharing user, write the code as Sharing\ user.
  • The Unique ID assigned to the first account on the system is 501. Choose a unique number for the ID.
  • 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