Scripting help - might be easy

Not applicable

I'm having a strange problem that is randomly showing up where the admin GROUP is being deleted from the users systems, demoting the local admin account to a standard user. The users are all standard users anyway so they don't notice a thing until they ask a tech to update/install something and the tech can't do it.

I have a fix I can run in terminal to delete the existing admin group, create a new one, and add the admin user to the admin group:

dseditgroup -o delete admin
dseditgroup -o create admin
dscl . -append /Groups/admin GroupMembership admin

Now, I wanted to add this as a self service option so that I don't have to remote into the machine and run this command via terminal, or be able to do it via ARD. But the problem I am having is that the terminal asks for confirmation (are you sure you want to do this? y or n) and I don't know how to skip that question or enter 'y'. Can someone give me a hand?

And has anyone heard of the admin group being deleted from a system randomly? This has never happened before, but now we are using Centrify Direct Control for connecting to AD. Not sure if there is a cause/effect relationship there or not.

Thanks for any help!

Rich Barron

2 REPLIES 2

tlarkin
Honored Contributor

Deleted randomly? No way, I have never heard of that happening. Are your local admin accounts in /Users? I have a few ideas I can toss at you that might help out a lot.



Thomas Larkin
TIS Department
KCKPS USD500
tlarki at kckps.org
blackberry: 913-449-7589
office: 913-627-0351

rmanly
Contributor III

I remember the "demotion" being a VERY common problem in 10.5.0 but it
should be resolved now. I have not seen it in upgraded software. I also
never thought to check back then whether the ultimate cause was related to
the admin group being missing. :(

Good luck!

http://support.apple.com/kb/TS1278

Ryan M. Manly
Mac OS X Expert
Glenbrook High Schools
1835 Landwehr Rd.
Glenview, IL 60026
(847) 486-4948