AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
Expand all | Collapse all

AIX Script to show users that have not logged in in 90 days

  • 1.  AIX Script to show users that have not logged in in 90 days

    Posted Wed May 09, 2018 08:23 AM

    Originally posted by: Ruan1234


    Hi everybody,

     

    I am looking for some help please.

    I need some assistance in writing a script to see which users have not logged on in 90 days.

    Does anyone know of a script i can use, or does anyone have any suggestions.

     

    I have tried using the last (username) command but it returns with an empty result for some users.

     

    Any help would be really appreciated.

     

    Thanks in adcance


    #AIX-Forum


  • 2.  Re: AIX Script to show users that have not logged in in 90 days

    Posted Thu May 10, 2018 04:30 PM

    Originally posted by: AncientAIXer


    If last returns an empty result, that usually means that the user has never logged in.  Some hints that might lead you in the right direction:

    The last time a user logged in is recorded in the /etc/security/lastlog file as time_last_login.  It is the epoch date.  If there is no stanza for the user, the account has never had any login activity, but a stanza could be there if the user has never successfully logged in.

    Another indication of no activity is if the user has been added and a password set for them which has to be changed at first log in, there will be an "ADMCHG" in the flags attribute in the user's stanza in /etc/security/passwd.


    #AIX-Forum


  • 3.  Re: AIX Script to show users that have not logged in in 90 days

    Posted Mon June 04, 2018 05:32 AM

    Originally posted by: nenifled


    Maybe this script can you with user administration:

    userattr

    https://www.ibm.com/developerworks/community/blogs/brian/entry/aix_user_attributes_in_depth2?lang=en_us

     

     


    #AIX-Forum