1753481 Members
4872 Online
108794 Solutions
New Discussion юеВ

Re: SYSUAF.LIS

 
Jasper_15
Occasional Advisor

SYSUAF.LIS

Hi,

I would like to extract the current user and their last login from the sysuaf.lis file. How would I proceed with this?

Thank you in advance.

Jorge C.
15 REPLIES 15
Joseph Huber_1
Honored Contributor

Re: SYSUAF.LIS

Don't attempt to parse the output of AUTHORIZE,
VMS has the SYS$GETUAI system service to ratrieve items from sysuaf.
See HELP SYSTEM $GETUAI.

There is a very nice freeware utility GETUAI.
To get the last login, one would do

getuai/last=last_login huber
sh symbol last_login
LAST_LOGIN = " 8-DEC-2005 19:57:27.9"

Find GETUAI at Hunter Goatleys fileserver:
HTTP://www.process.com/openvms
http://www.mpp.mpg.de/~huber
Arch_Muthiah
Honored Contributor

Re: SYSUAF.LIS

Jorge,

$ write sys$output f$getjpi("","last_login_n") will diaplay the last login time of the current user.

If you know the PID of any specific user's PID, you can pass that PID as the Ist arg to this f$getjpi(pid_of_anu_user,"last_login_n")

using other f$PID, f$extract functions, will help you find the exact username if you feel difficulties finding the username using PID.

If you want to get this last login time from any other high level prog, then there is macro defn (may be $LOGINDEF) where eyou can find the symbol for last login, that can be passed to your prog.

Archunan
Regards
Archie
Arch_Muthiah
Honored Contributor

Re: SYSUAF.LIS

sorry, the macro name is $UAFDEF and the symbol UAF$Q_LASTLOGIN_N.


Archunan
Regards
Archie
Peter Zeiszler
Trusted Contributor

Re: SYSUAF.LIS

Definitely look into the GETUAI freeware utility.

You can create your own script for parsing the data out. Once you have the USERNAME its just


$! check for machine type and assign proper getuai
$!
$ if f$edit(f$extract(0,3,f$getsyi("HW_NAME")),"UPCASE") .eqs. "ALP"
$ then
$ getuai = "$tools:[mgr.getuai]getuai.alpha_exe"
$ else
$ getuai = "$tools:[mgr.getuai]getuai.exe"
$ endif
$ getuai 'username /interactive_login=ilogin /noninteractive_login=nonlogin
$ show sym ilogin
$ show sym nonlogin

If the person has never logged in then it will return NONE, otherwise it will return the date & time of the last login.
Arch_Muthiah
Honored Contributor

Re: SYSUAF.LIS

Jorge C,

from DCL, you can get the last llgin using this single command

$ PIPE search sysuaf.lis "username"/window=(1,9) | search sys$input "last login"

you will last intercative and non-intercative login time.


Archunan
Regards
Archie
Jan van den Ende
Honored Contributor

Re: SYSUAF.LIS

Jorge,

to repeat Hein's favorite question: "What problem are you trying to solve"

The "current user" are you yourself.
Unless this is an account used by other users as well (a VERY un-desirable approach, leading to the well-chosen nick-name "whore-account", because everybody is using it, and when something ill comes to pass, everybody can claim: "it was not me"), so, what special info would you desire to get from your own "last login".
Are you really interested whether you(r account) did do another Login since this session started?

The various answers given above should supply the answer, but I am REALLY curious for the background of THIS question!

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Jasper_15
Occasional Advisor

Re: SYSUAF.LIS

Hi,

I am just trying to pull all the users from our VMS system with active or non-active with their last login info for accounting purpose. Help!!
Jan van den Ende
Honored Contributor

Re: SYSUAF.LIS

Jorge,

so, not the current user, but all authorised users?

Now, we get into the infamous: What version?
question.

IF your system supports PIPE (sinve VMS 7.something)

$ PIPE MCR AUTHORIZE SHOW *|SEARCH SYS$PIPE "Username:","Last login" /OUTPUT=

Older versions:

$ MCR LIST * /FULL
$ SEARCH SYSUAF.LIS "Username:","Last login"/OUTPUT=

Success.

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Hein van den Heuvel
Honored Contributor

Re: SYSUAF.LIS

Asked and answerred many times before, including in this forum:

google: +vms +"last login" +site:itrc.hp.com

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=890732

Regards,
Hein.