• 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: List of users/accounts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: List of users/accounts


  • Subject: Re: List of users/accounts
  • From: John Fieber <email@hidden>
  • Date: Mon, 15 Nov 2004 17:55:55 -0800

On Nov 15, 2004, at 7:05 AM, email@hidden wrote:

You can alos try :

do shell script "niutil -list . /users"

You'll have the complete list of the users available on the machine, including System accounts.

In panther you would be better off using dscl:

   dscl localhost list /Search/Users

This should pick up all accounts the machine knows about regardless of where the account data are defined...BSD /etc files, netinfo, ldap, active directory or whatever. niutil will miss some of those. [footnote: Using dscl you can also learn about how DirectoryServices is configured, including what data sources have been set up and what the data source search path is.]

A more AppleScripty way of getting a user list is using System Events:

tell application "System Events"
	set userList to users
end tell

But you can't get very much detail about an account compared to dscl.

Listing the files in /Users is not a very good way of determining what accounts exists.

-john

_______________________________________________
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


References: 
 >Re: List of users/accounts (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: itunes and duplicating track from library
  • Next by Date: Re: Contacts whose email clauses in Entourage X
  • Previous by thread: Re: List of users/accounts
  • Next by thread: Launching Remote Applications
  • Index(es):
    • Date
    • Thread