Posted on 09-23-2009 04:36 AM
Hi-
I'm trying to make a self service policy that will remove a known setup account. However, when you run it, it doesn't actually remove the account. Jamf.log checks out ok but there's not much detail there. I can however, successfully remove the account with remote.
any ideas?
j
---
Jared F. Nichols
Desktop Engineer, Infrastructure & Operations
Information Services Department
MIT Lincoln Laboratory
244 Wood Street
Lexington, Massachusetts 02420
781.981.5436
Posted on 09-23-2009 06:15 AM
You could try doing it with a script instead of 'jamf deleteAccount'
dscl . -delete /Users/$USER
rm -rf /Users/$USER
Posted on 09-23-2009 06:43 AM
I was going to suggest the same thing, but maybe do it via a loop
This is going to assume you know the user name
#!/bin/bash
#see if the current user is there
bad_user=/bin/ls /Users | grep <shortname> -c
#now compare to execute deletion
if [ $bad_user -eq 1 ] ; do
/usr/sbin/dscl . -delete /Users/$bad_user
/bin/rm -rf /Users/$bad_user
else echo "$bad_user not found"
fi
done
exit 0
That was very quick and dirty, so of course test test test
Posted on 09-23-2009 06:48 AM
I like your grep -c test !
I should have stated these are the commands you need now run with it ;)