• 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: getting users
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting users


  • Subject: Re: getting users
  • From: Graff <email@hidden>
  • Date: Mon, 12 Jan 2004 22:33:51 -0500

Here are two ways to do it on Mac OS X, depending on how in-depth you want to get.

If you are just wondering about people who have local home directories then this is an easy way:

set theList to do shell script "ls -1 /Users/ | awk '{ if ( $1 != \"Shared\") print }'"
set userList to every paragraph of theList

If you want to know every account, even those who do not have a local home directory then you can do this. The problem with this method is that you get EVERY account registered with the system, even those which may not actually be people! Some accounts are created in order to provide a safe way for programs to operate with limited privileges:

set theList to do shell script "niutil -list . /users | awk '{ print $2 }'"
set userList to every paragraph of theList

- Ken

On Jan 12, 2004, at 6:36 PM, Martha Espinosa wrote:

Is there a way to use applescript to find out who has an account on a machine...

Thanks In Advance..
_______________________________________________
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.

References: 
 >getting users (From: Martha Espinosa <email@hidden>)

  • Prev by Date: Re: Images and FMP
  • Next by Date: Re: Create a Mail signature using AppleScript
  • Previous by thread: getting users
  • Next by thread: Re: getting users
  • Index(es):
    • Date
    • Thread