Fully delete users account on M1 MacBooks Air

ajanicke
New Contributor III

We've got a Journalism cart that has about 26 MacBooks in it. Some issues popped up and I wanted to test clearing out the profiles daily because some students just don't listen and keep ~50GB in their profile even though they have external drives for their work.

I have a pretty simple script that just makes sure to ignore our admin accounts and runs a..

for a in $userList

sysadminctl -deleteUser $a

This seems to work and the home folder is gone but the account is still technically there when you go into users and groups. So when we try to login the MacBook just hangs since there's technically an account still there but no home folder.

These users are not secure token holders since only students use them so it's not that and they are Jamf Connect created accounts.

Is this just not possible on M1s? They had Intel Macs before I got here and said they used this script all the time but now it just falls a little short with fully removing the account from the device.

1 ACCEPTED SOLUTION

ajanicke
New Contributor III

The solution seems to be to use Jamf's binary instead because it resolves this issue better than Apple's own!

jamf deleteUser -username {username} -deleteHomeDirectory

View solution in original post

1 REPLY 1

ajanicke
New Contributor III

The solution seems to be to use Jamf's binary instead because it resolves this issue better than Apple's own!

jamf deleteUser -username {username} -deleteHomeDirectory