• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to automate creation of user accounts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to automate creation of user accounts
      • From: "John C. Welch" <email@hidden>
References: 
 >How to automate creation of user accounts (From: Paul Humphrey <email@hidden>)

  • Prev by Date: Secure delete of Mail's trash and junk
  • Next by Date: Re: How to automate creation of user accounts
  • Previous by thread: How to automate creation of user accounts
  • Next by thread: Re: How to automate creation of user accounts
  • Index(es):
    • Date
    • Thread