Originally posted by: tony.evans
As long as you run the script from root, you can do this reasonably easily.
You can use "lsuser -a maxage <user id>" to get the max age and convert it to seconds (something like "maxage_seconds=$(( ${maxage} * 7 * 24 * 60 * 60 ))" ), get the last updated time using "pwdadm -q <user id> | grep lastupdate", and then do some basic maths to work out when it's going to (or if it has already) expired.
Only root (by default) can run the pwdadm command and get the lastupdated value.
You can't even do it for your own account (by default).
#AIX-Forum