Re: In the "I could have done it faster by hand" department
Re: In the "I could have done it faster by hand" department
- Subject: Re: In the "I could have done it faster by hand" department
- From: Gnarlodious <email@hidden>
- Date: Sun, 16 May 2004 07:33:11 -0600
Entity c w spoke thus:
>
Is there a reasonably straightforward way to script the creation of new
>
users? I have 26 users that I need to add to a bunch of machines.
>
>
I have all the parameters in a table.
If you need to check existing users first there are ways to do it but it's
too much for me right now.
This should give you an idea.
Untested!
set nl to ASCII character 10
set newUser to "abuser"
set createUser to quoted form of "user=" & newUser & nl & ,
"# create a user named $user with password 1234" & nl & ,
"# to remove the user later try nidump -destroy / /users/$user" & nl & ,
"niutil -create / /users/$user" & nl & ,
"niutil -createprop / /users/$user uid 532" & nl & ,
"niutil -createprop / /users/$user realname\"$user\"" & nl & ,
"niutil -createprop / /users/$user home\"/Users/$user\"" & nl & ,
"niutil -createprop / /users/$user shell\"/bin/bash\"" & nl & ,
"niutil -createprop / /users/$user gid 20" & nl & ,
"niutil -createprop / /users/$user passwd\"rQ3p5/hpOpvGE\" #(it's 1234)"
& nl & ,
"chown -R $user:staff /Users/$user" & nl & ,
"chmod -Rf 755 /Users/$user"
--do shell script createUser
--
Gnarlie's virtual Tour de Santa Fe
http://www.Gnarlodious.com/SantaFe/Tour.php
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.