Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dormant user accounts

Status
Not open for further replies.

drmanager

IS-IT--Management
Jan 22, 2002
13
0
0
US
Running AIX 5.1 on 6C3 and need to find and identify all dormant user accounts (logins). Does anyone know of a way to use usrck, pwdck, or another utility to accomplish this? [blush]
 
Quick and dirty, printing both aged and never used:

Code:
#!/usr/bin/perl 

BEGIN{
     $dormant_days=90;
     $threshold=time - (24*3600*$dormant_days)
     }

open CMD, "lsuser -a time_last_login ALL|";
while ( <CMD> )
{
print if /time_last_login=(\d+)/ && ( $1 < $threshold);
print unless /time_last_login/;
}

Don't do any automated locking based on this without adding exceptions for machine accounts that never login like lpd and nobody.

Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top