Re: How to automate creation of user accounts
Re: How to automate creation of user accounts
- Subject: Re: How to automate creation of user accounts
- From: Gnarlodious <email@hidden>
- Date: Fri, 14 Apr 2006 20:40:44 -0600
- Thread-topic: How to automate creation of user accounts
Entity Paul Humphrey spoke thus:
> I desire to automate the creation of user accounts. Is this possible
> with AppleScript
This script creates a new user called "abuser" with password "1234":
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
Uncomment the last command to actually create the user.
-- Gnarlie
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden