Skip to main content
Question

Script to delete inactive accounts on computers

  • September 13, 2019
  • 7 replies
  • 2 views

Forum|alt.badge.img+2

Hello everyone,

I need help to create a new script and employ on my work. Can you help me?

I need a script that removes a user account from all computers if the user has inactivity for maybe 30 days.
I search about this task and only find removing from AD and removing from Mobile, and I want to remove it from computers that have the user account on it.

I'm new in JAMF world, so I am grateful for any help.

Best Regards.

7 replies

Forum|alt.badge.img+2
  • Author
  • New Contributor
  • 1 reply
  • September 16, 2019

Any news?


Forum|alt.badge.img+15
  • Esteemed Contributor
  • 719 replies
  • September 16, 2019

Forum|alt.badge.img+31
  • Honored Contributor
  • 2721 replies
  • September 16, 2019

If you use FileVault 2 and do this, you're gonna have a bad time


Forum|alt.badge.img+15
  • Esteemed Contributor
  • 719 replies
  • September 16, 2019

@tlarkin If you stick to using "sysadminctl -deleteUser" I think it won't let you delete the last secure token holder. I could be wrong though.


Forum|alt.badge.img+31
  • Honored Contributor
  • 2721 replies
  • September 16, 2019

When you re-add the user, you are gonna have a bad time, gotta do expect stuff


Forum|alt.badge.img+8

I'm after a similar script. I think what I want is this one: https://www.jamf.com/jamf-nation/discussions/15210/assistance-needed-deleting-mobile-accounts-older-than-30-days but for some reason it isn't working properly for me (see my reply to that post). I'm wondering if this is a Catalina thing? Or am I doing something wrong? I'm after a script that deletes local users (+home folders) after X days with the exception of custom set User accounts. The local accounts are not AD/Mobile Users but regular Local accounts.

Any help is much appreciated.


Mauricio11
Forum|alt.badge.img+11
  • Valued Contributor
  • 173 replies
  • February 11, 2020

@MagicMick I've added some comments into that post.

One possible cause is SIP


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings