scripting for user accounts info in UX

Hi guys,

May I know how do I list out in UX for

  • all existing user accounts; sorted by activated/disabled
  • primary/sec groups of each user
  • date when the user accounts are created,
  • user last logon date
  • last password change date

Anyone had done scripting for these info?
Appreciate for any guidance...thanks