List all users in Mac

expand collapsive

Hey, we have some macs in the office. Each employee has a separate user account on the mac. I need to get the list of all users in the mac devices. But, checking each device manually is a tedious and time-consuming task. Is there any other way to obtain this?
Also, I have to check the size of directories of some users to know if they have enough space to work.

All Replies

  • Thank you for reaching out to us @noudtwan.
    Yes, you can deploy custom scripts from the Hexnode portal to list all users on your macOS devices. Here is the script to get the job done.

    Regarding your second query, you can find the size of home directories of required users with the command given below. The above script will also return the user’s home directory. Hence, you can use this information to determine the size of required users’ home directories.

    Replace “/directory/path” with your user’s home directory.

    The total size of the directory can be found on the last line of the output.
    Please validate the script on a system before executing in bulk. Because if the script has any issue, it may put your devices at risk.

    If you have any doubt about deploying scripts, please check out our help doc on executing custom scripts on macOS devices to know more.

    Hope this meets your requirements. Do reach out if you have any further queries.

    Evin Lee
    Hexnode Uem