Disable some local accounts

Sobchak
Contributor

Does anyone have a script that will detect all local accounts and disable all but a specific account?

Basically I want to disable all of the accounts on a specific Mac except the one authorized account. These macs are not AD joined.

3 REPLIES 3

vasani
New Contributor II

@Sobchak I might be able to help here, but the bigger question is; how are other accounts getting created? Do you have 1 local admin and you want to keep that account? Do you have 1 local admin and 1 standard, and you want to keep the standard? Describe the environment for me.

-Amit

Sobchak
Contributor

Sadly our Mac users are admins and the Macs are not joined to the domain. So they could have any number of admin and standard accounts.

That being said we found a script that solves our problem.

jefff
Contributor II

I was thinking this topic sounded familiar, so I did a search to confirm my suspicion. There was an earlier thread with a solution for deleting all users except the local admin. Does that help?

https://www.jamf.com/jamf-nation/discussions/7584/delete-all-users-except-local-admin