cancel
Showing results for 
Search instead for 
Did you mean: 

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
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.
Joseph Huber_1
Honored Contributor

Re: SYSUAF.LIS

Short of reading the manual now :-), but definitely f$getjpi("","last_login_n") does not show the users last login:

live example:
write sys$output f$getjpi("","last_login_n")
2-DEC-2005 09:33:58.55

write sys$output f$getjpi("","last_login_i")
4-DEC-2005 20:59:18.28

authorize show huber
Last Login: 9-DEC-2005 08:54 (interactive),
7-DEC-2005 10:54 (non-interactive)

http://www.mpp.mpg.de/~huber
Joseph Huber_1
Honored Contributor

Re: SYSUAF.LIS

Aah yes, $getjpi last_login_% items return the last login times prior to the start of the current process or session, i.e. the date seen in $getuai at process creation time.

There is, by the way, another utility: LAST
at
ftp://ftp.process.com/vms-freeware/fileserv/last.zip

which does the list for system managers in one go:
LAST/ALL_USERS

http://www.mpp.mpg.de/~huber
John Donovan_4
Frequent Advisor

Re: SYSUAF.LIS

We use Jim Snyder's SCANUAF to do SYSUAF accounting reports and tracking. It's awesome freeware and can be used remotely to get info from other nodes. One source I have for it is Hunter's site:

http://vms.process.com/scripts/fileserv/fileserv.com?SCANUAF

I hope this helps
"Difficult to see, always in motion is the future..."
John Donovan_4
Frequent Advisor

Re: SYSUAF.LIS

Oh yeah, its also on Encompass' WEB:

http://www.encompassus.org/ftplib/VS0174_SCANUAF_AAAREADME_1ST.html
"Difficult to see, always in motion is the future..."
Jorge Cocomess
Super Advisor

Re: SYSUAF.LIS

Great info. I will give it try. Does anyone know how I can assign points?

Thanks,
Volker Halle
Honored Contributor

Re: SYSUAF.LIS

Jorge,

only the initial author of the thread can assign points, see:

http://forums1.itrc.hp.com/service/forums/helptips.do?#33

In this case, it would be user: Jasper

Volker.