Reply To: Delete user acc in mac 

#14350
AvatarJohan Blake
Moderator
1 pt

Hey @diane-joyce,
Thank you for reaching out to us.

With Hexnode UEM, you can remotely delete a user account by executing a set of commands using the Execute Custom Script action. To make use of the action, head over to Manage > Devices > select your device > Actions > Execute Custom Script.

To delete the required user account, execute the below Bash command after replacing the <username> field with the target user name.

sudo dscl . delete /users/<username>

Now, execute the below script after replacing the <username> field with the target username to delete the directories and files of the user.

sudo rm -rf /users/<username>

If the username contains spaces, omit them when substituting in the script. Executing these commands in succession will result in the complete deletion of the user account and related data.
The above scripts are obtained from third-party open-source sites, and hence, Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

Hope this clears your query.

Cheers!
Johan Blake
Hexnode UEM