Page 1 of 1 1
Topic Options
#7574 - 2001-03-15 01:07 PM Help on last user logon script please!
Anonymous
Unregistered


I have tried copying and pasting the entire script to my logon.kix but nothing seems to be happening. I have only made the 2 necessary changes (in the 24th and 25th line of the Script). One is instead of $logon_server="IT Company", I changed it to $logon_server="MyServerName"

2nd change would be to change the $user_drive="s:" to $user_drive="z:"

I do not use roaming profiles in my workplace, but for my testing account, I just set my home directory to z: which connects it to the Profiles$ share on my server. Would I have to enter the User Profile column as well? or would that not make a difference?

Are these changes enough? Why isn't anything showing like what was the last previously logged on time, etc. I have checked that the logon.lst file does not exist in the Profiles$ directory on the server, even though I have logged on twice. I have also made sure that the Profiles$ directory I have created allows full control to everybody.

There doesn't seem to be an error in the script, 'cos I don't see any red lines that say error.

I'll include a script here for reference. Hope someone can help me.


?
? "Today is " @DAY ", " @DATE ". Current Time is " @TIME
?
SLEEP 4

$filename=Dir("c:\patches\chg0228.txt")
IF @ERROR=0
?
?
?
? "You have the latest Anti-Virus Definitions installed."
Sleep 2
goto LASTUSER
ELSE
CALL %0\..\Nav
ENDIF

:LASTUSER
IF setconsole("hide")
ENDIF
;
;
;
; vs 1.00 - program
;
; 1.00 (20000615) original version.
; - special variables:
; $logon_server="IT company"
; $user_drive="s:"
; - special file:
; $user_drive+"\logon.lst" (file.attributes: hidden/read-only/system)
;
$prgrm_version="1.00"
$prgrm_publication_date="15.3.2001"
;
$time_start=@time
;
$cr=CHR(10)
$lf=CHR(13)
$eol=$lf ; - $cr+$lf -
;
$logon_server="SAPL2"
$user_drive="Z:" ; - variable used by calculation of possible missing "$user" value -

IF (@inwin = 1)
$NT_mode="yes"
ELSE
$NT_mode="no"
ENDIF
IF (len(@ipaddress0) = 0)
$offline_mode="yes"
ELSE
$offline_mode="no"
ENDIF

; --------------------------------------------------------------------------
; - -
; --------------------------------------------------------------------------

$domain=""
$ldomain=""
IF ($NT_mode = "yes")
$ikey="HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon"
IF (ExistKey($ikey) = 0)
$domain=ReadValue($ikey, "DefaultDomainName")
ENDIF
$ikey="HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon"
IF (ExistKey($ikey) = 0)
$ldomain=ReadValue($ikey, "CachePrimaryDomain")
ENDIF
ELSE
$ikey="HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSNP2\NetworkProvider"
IF (ExistKey($ikey) = 0)
$domain=ReadValue($ikey, "AuthenticatingAgent")
ENDIF
$ikey="HKEY_LOCAL_MACHINE\Security\Provider"
IF (ExistKey($ikey) = 0)
$ldomain=ReadValue($ikey, "Container")
ENDIF
ENDIF
IF (len($domain) = 0)
IF (len(@ldomain) <> 0)
$domain=@ldomain
ELSE
$domain=@domain
ENDIF
IF (len($domain) = 0)
$domain="~domain" ; - unknown @domain/@ldomain value -
ENDIF
ENDIF
IF (len($ldomain) = 0)
$ldomain=$domain
ENDIF
;
break off
MD "c:\temp"
IF (@error = 0)
ENDIF
IF (RedirectOutput("nul",1) = 0)
ENDIF
flushkb

IF ($NT_mode = "yes")
$time_stop=@time
$log_info="Kixtart-LOG "+$prgrm_version+" script started"
$log_info=$log_info+" for '"+LCASE(@userid)+"'"
$log_info=$log_info+" ("+$time_start+" - '"+@ipaddress0+"')"
IF logevent(0, 1, $log_info, "", "Kixtart LOG @kix")
ENDIF
ENDIF
;
IF setconsole("hide")
ENDIF

; --------------------------------------------------------------------------
; - special variables settings -
; --------------------------------------------------------------------------

$section=substr(@date,3,2)
IF (@ydayno < 10)
$section=$section+"00"+@ydayno
ELSE
IF (@ydayno < 100)
$section=$section+"0"+@ydayno
ELSE
$section=$section+@ydayno
ENDIF
ENDIF
$key=$section+"_"
$key=$key+substr(@date,3,2)+substr(@date,6,2)+substr(@date,9,2)
$key=$key+"_"
$key=$key+@time
$key=$key+" "+$domain

$x=""
$tmp=""
$tmp_short=""

IF (len(@ipaddress0) = 0)
$offline_mode="yes"
IF ($NT_mode = "yes")
$x=$x+"(NT - vs "+$prgrm_version+" - off-line )"
ELSE
$x=$x+"(95 - vs "+$prgrm_version+" - off-line )"
ENDIF
ELSE
$offline_mode="no"
IF (len(@lserver) = 0)
$lserver="~lserver "
ELSE
$lserver=@lserver ; - \\spln99999 -
ENDIF
IF (LCASE($domain) = LCASE($ldomain))
IF ($NT_mode = "yes")
$x=$x+"(NT - vs "+$prgrm_version+" L $domain $lserver)"
ELSE
$x=$x+"(95 - vs "+$prgrm_version+" L $domain $lserver)"
ENDIF
ELSE
IF ($NT_mode = "yes")
$x=$x+"(NT - vs "+$prgrm_version+" - $domain $lserver)"
ELSE
$x=$x+"(95 - vs "+$prgrm_version+" - $domain $lserver)"
ENDIF
ENDIF
ENDIF
$tmp_short=$x

IF (len(@ipaddress0) = 15)
$i=1
$ip_old=@ipaddress0
$ip_new=""
DO
IF (substr($ip_old,$i,1) <> " ")
$ip_new=$ip_new+substr($ip_old,$i,1)
ELSE
$ip_new=$ip_new+"0"
ENDIF
$i=$i+1
UNTIL ($i > 15)
ELSE
$ip_new="xxx.xxx.xxx.xxx"
ENDIF
$x=$x+" "+$ip_new

IF (len(@address) = 0)
$address="xxxxxxxxxxxx"
; $address="xx-xx-xx-xx-xx-xx"
ELSE
$address=@address
; $address= substr(@address,1,2)+"-"+substr(@address,3,2)+"-"+substr(@address,5,2)
; $address=$address+"-"+substr(@address,7,2)+"-"+substr(@address,9,2)+"-"+substr(@address,11,2)
ENDIF
$x=$x+" "+$address

$user=""
IF ($NT_mode = "yes")
$ikey="HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon"
IF (ExistKey($ikey) = 0)
$user=ReadValue($ikey, "DefaultUserName")
ENDIF
ELSE
$ikey="HKEY_LOCAL_MACHINE\System\CurrentControlSet\control"
IF (ExistKey($ikey) = 0)
$user=ReadValue($ikey, "Current User")
ENDIF
ENDIF
IF (len($user) = 0)
$user=@userid
IF (len($user) = 0)
$user="~user"
ENDIF
ENDIF
$x=$x+" "+$user
$tmp_short=$tmp_short+" "+$user

IF (len(@wksta) = 0)
$x=$x+" ~wksta"
$tmp_short=$tmp_short+" ~wksta"
ELSE
$x=$x+" "+@wksta
$tmp_short=$tmp_short+" "+@wksta
ENDIF
IF (len(@fullname) = 0)
IF (len(@comment) = 0)
$x=$x+" ('~fullname')"
ELSE
$x=$x+" ('~fullname'+'"+@comment+"')"
ENDIF
$tmp_short=$tmp_short+" '~fullname'"
$fullname=$user
ELSE
IF (len(@comment) = 0)
$x=$x+" ('@fullname')"
ELSE
$x=$x+" ('"+@fullname+"'+'"+@comment+"')"
ENDIF
$tmp_short=$tmp_short+" '"+@fullname+"'"
$fullname=$user
ENDIF
;
$admin_user="no"
IF (INGROUP("Administrators") = 1) OR (INGROUP("Administrators") = 2)
$admin_user="yes"
ENDIF
IF (INGROUP("Domain Admins") = 1) OR (INGROUP("Domain Admins") = 2)
$admin_user="yes"
ENDIF

$tmp=$x
;
$license="yes"

; --------------------------------------------------------------------------
; - get last user logon information -
; --------------------------------------------------------------------------

$last_logon_message="Last logon by '"+$fullname+"' at "+LCASE(@day)+" "+@mdayno+"-"+LCASE(substr(@month,1,3))+"-"+@year+" "+@time
$last_workstation= "Location pc '"+UCASE(@wksta)+"' of domain '"+UCASE($domain)+"'"
$previous_logon_message="<unknown>"
$previous_workstation="<unknown>"
;
$filename=$user_drive+"\logon.lst"
IF (exist($filename) = 1)
IF (setfileattr($filename, 128) <> 0)
ENDIF
$previous_logon_message=readprofilestring($filename, "last logon", "user")
$previous_workstation=readprofilestring($filename, "last logon", "workstation")
ENDIF
IF (writeprofilestring($filename, "last logon", "user", $last_logon_message) <> 0)
? @serror
ENDIF
IF (writeprofilestring($filename, "last logon", "workstation", $last_workstation) <> 0)
? @serror
ENDIF
IF (setfileattr($filename, 7) <> 0) ; -RHS-
? @serror
ENDIF
;
IF (exist($filename) = 1)
IF (len($previous_logon_message) = 0)
$previous_logon_message="<unknown>"
ENDIF
ENDIF
;
IF ($previous_logon_message <> "<unknown>")
$msg= "Welcome to "+$logon_server+" network"+$lf
$msg=$msg+$lf
$msg=$msg+$lf
$msg= "Note: internal systems must be used only for con-"+$lf
$msg=$msg+" ducting business, or for purpose authorized"+$lf
$msg=$msg+" by management."+$lf
$msg=$msg+$lf
$msg=$msg+"Use is subject to audit at any time by management."+$lf
$msg=$msg+$lf
$msg=$msg+$lf
$msg=$msg+$previous_logon_message+$lf
IF ($admin_user = "yes")
$msg=$msg+$lf
$msg=$msg+$previous_workstation
ENDIF
;
IF (MessageBox($msg, $logon_server, 64, 10) <> 0)
? @serror
ENDIF
ENDIF

; --------------------------------------------------------------------------
; - end -
; --------------------------------------------------------------------------

:end_script

; IF (@priv = "ADMIN")
; color R+/W
; ? "Your are SUPERVISOR!"
; play "0g500f120t"
; sleep 5
; ENDIF

$time_stop=@time
IF ($NT_mode = "yes")
$log_info="Kixtart-LOG "+$prgrm_version+" script completed successfully"
$log_info=$log_info+" for '"+LCASE($user)+"' "+UCASE($domain)
$log_info=$log_info+" ("+$time_start+" - "+$time_stop+" - '"+$ip_new+"')"
IF (len($fullname) > 0)
$log_info=$log_info+" '"+LCASE($fullname)+"'"
$log_info=$log_info+" '"+$previous_logon_message+"'"
$log_info=$log_info+" '"+$previous_workstation+"'"
ENDIF
;
IF logevent(0, 1, $log_info, "", "Kixtart LOG @kix"+"s")
ENDIF
ENDIF
play "0g500f60t"
break on
flushkb


:END
quit

[This message has been edited by Rivers (edited 15 March 2001).]

Top
#7575 - 2001-03-19 05:42 PM Re: Help on last user logon script please!
CLPowell Offline
Getting the hang of it

Registered: 2000-05-08
Posts: 59
Loc: San Angelo, Texas, USA 76903
What client os do you have?
_________________________
Chris Powell
Fire Technology Manager

Top
#7576 - 2001-03-23 02:51 AM Re: Help on last user logon script please!
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear Eugene,

I read your information and I think that your problem can be the usage of drive Z. Drive Z has a special status within windows
with and without network connection.
My suggestion is the usage of drive C first to check the correctness of your script.

With the kixstrip.exe tool of our site we detect a problem with one line. The output of it have we included. The possible cause
can be the type of editor your are using. Some editors inserts automatically a line-wrap.

Correct line:

$last_logon_message="Last logon by '"+$fullname+"' at "+
LCASE(@day)+" "+@mdayno+"-"+LCASE(substr(@month,1,3))+"-"+@year+" "+@time

The output of kixstrip with options /debug /print is:

code:

?"- 3-" ?
?"- 4-" ? "Today is " @day ", " @date ". Current Time is " @time
?"- 5-" ?
?"- 6-" SLEEP 4
?"- 8-" $filename=Dir("c:\patches\chg0228.txt")
?"- 9-" IF @error=0
?"- 10-" ?
?"- 11-" ?
?"- 12-" ?
?"- 13-" ? "You have the latest Anti-Virus Definitions installed."
?"- 14-" SLEEP 2
?"- 15-" GOTO LASTUSER
?"- 16-" ELSE
?"- 17-" CALL %0\..\Nav
?"- 18-" ENDIF
?"- 22-" :lastuser
?"- 23-" IF setconsole("hide")
?"- 24-" ENDIF
?"- 37-" $prgrm_version="1.00"
?"- 38-" $prgrm_publication_date="15.3.2001"
?"- 40-" $time_start=@time
?"- 42-" $cr=CHR(10)
?"- 43-" $lf=CHR(13)
?"- 44-" $eol=$lf
?"- 46-" $logon_server="SAPL2"
?"- 47-" $user_drive="Z:"
?"- 49-" IF (@inwin=1)
?"- 50-" $nt_mode="yes"
?"- 51-" ELSE
?"- 52-" $nt_mode="no"
?"- 53-" ENDIF
?"- 54-" IF (len(@ipaddress0)=0)
?"- 55-" $offline_mode="yes"
?"- 56-" ELSE
?"- 57-" $offline_mode="no"
?"- 58-" ENDIF
?"- 64-" $domain=""
?"- 65-" $ldomain=""
?"- 66-" IF ($nt_mode="yes")
?"- 67-" $ikey="HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon"
?"- 68-" IF (ExistKey($ikey)=0)
?"- 69-" $domain=ReadValue($ikey,"DefaultDomainName")
?"- 70-" ENDIF
?"- 71-" $ikey="HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon"
?"- 72-" IF (ExistKey($ikey)=0)
?"- 73-" $ldomain=ReadValue($ikey,"CachePrimaryDomain")
?"- 74-" ENDIF
?"- 75-" ELSE
?"- 76-" $ikey="HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSNP2\NetworkProvider"
?"- 77-" IF (ExistKey($ikey)=0)
?"- 78-" $domain=ReadValue($ikey,"AuthenticatingAgent")
?"- 79-" ENDIF
?"- 80-" $ikey="HKEY_LOCAL_MACHINE\Security\Provider"
?"- 81-" IF (ExistKey($ikey)=0)
?"- 82-" $ldomain=ReadValue($ikey,"Container")
?"- 83-" ENDIF
?"- 84-" ENDIF
?"- 85-" IF (len($domain)=0)
?"- 86-" IF (len(@ldomain)<>0)
?"- 87-" $domain=@ldomain
?"- 88-" ELSE
?"- 89-" $domain=@domain
?"- 90-" ENDIF
?"- 91-" IF (len($domain)=0)
?"- 92-" $domain="~domain"
?"- 93-" ENDIF
?"- 94-" ENDIF
?"- 95-" IF (len($ldomain)=0)
?"- 96-" $ldomain=$domain
?"- 97-" ENDIF
?"- 99-" BREAK off
?"- 100-" MD "c:\temp"
?"- 101-" IF (@error=0)
?"- 102-" ENDIF
?"- 103-" IF (RedirectOutput("nul",1)=0)
?"- 104-" ENDIF
?"- 105-" FLUSHKB
?"- 107-" IF ($nt_mode="yes")
?"- 108-" $time_stop=@time
?"- 109-" $log_info="Kixtart-LOG "+$prgrm_version+" script started"
?"- 110-" $log_info=$log_info+" for '"+LCASE(@userid)+"'"
?"- 111-" $log_info=$log_info+" ("+$time_start+" - '"+@ipaddress0+"')"
?"- 112-" IF logevent(0,1,$log_info,"","Kixtart LOG @kix")
?"- 113-" ENDIF
?"- 114-" ENDIF
?"- 116-" IF setconsole("hide")
?"- 117-" ENDIF
?"- 123-" $section=substr(@date,3,2)
?"- 124-" IF (@ydayno<10)
?"- 125-" $section=$section+"00"+@ydayno
?"- 126-" ELSE
?"- 127-" IF (@ydayno<100)
?"- 128-" $section=$section+"0"+@ydayno
?"- 129-" ELSE
?"- 130-" $section=$section+@ydayno
?"- 131-" ENDIF
?"- 132-" ENDIF
?"- 133-" $key=$section+"_"
?"- 134-" $key=$key+substr(@date,3,2)+substr(@date,6,2)+substr(@date,9,2)
?"- 135-" $key=$key+"_"
?"- 136-" $key=$key+@time
?"- 137-" $key=$key+" "+$domain
?"- 139-" $x=""
?"- 140-" $tmp=""
?"- 141-" $tmp_short=""
?"- 143-" IF (len(@ipaddress0)=0)
?"- 144-" $offline_mode="yes"
?"- 145-" IF ($nt_mode="yes")
?"- 146-" $x=$x+"(NT - vs "+$prgrm_version+" - off-line )"
?"- 147-" ELSE
?"- 148-" $x=$x+"(95 - vs "+$prgrm_version+" - off-line )"
?"- 149-" ENDIF
?"- 150-" ELSE
?"- 151-" $offline_mode="no"
?"- 152-" IF (len(@lserver)=0)
?"- 153-" $lserver="~lserver "
?"- 154-" ELSE
?"- 155-" $lserver=@lserver
?"- 156-" ENDIF
?"- 157-" IF (LCASE($domain)=LCASE($ldomain))
?"- 158-" IF ($nt_mode="yes")
?"- 159-" $x=$x+"(NT - vs "+$prgrm_version+" L $domain $lserver)"
?"- 160-" ELSE
?"- 161-" $x=$x+"(95 - vs "+$prgrm_version+" L $domain $lserver)"
?"- 162-" ENDIF
?"- 163-" ELSE
?"- 164-" IF ($nt_mode="yes")
?"- 165-" $x=$x+"(NT - vs "+$prgrm_version+" - $domain $lserver)"
?"- 166-" ELSE
?"- 167-" $x=$x+"(95 - vs "+$prgrm_version+" - $domain $lserver)"
?"- 168-" ENDIF
?"- 169-" ENDIF
?"- 170-" ENDIF
?"- 171-" $tmp_short=$x
?"- 173-" IF (len(@ipaddress0)=15)
?"- 174-" $i=1
?"- 175-" $ip_old=@ipaddress0
?"- 176-" $ip_new=""
?"- 177-" DO
?"- 178-" IF (substr($ip_old,$i,1)<>" ")
?"- 179-" $ip_new=$ip_new+substr($ip_old,$i,1)
?"- 180-" ELSE
?"- 181-" $ip_new=$ip_new+"0"
?"- 182-" ENDIF
?"- 183-" $i=$i+1
?"- 184-" UNTIL ($i>15)
?"- 185-" ELSE
?"- 186-" $ip_new="xxx.xxx.xxx.xxx"
?"- 187-" ENDIF
?"- 188-" $x=$x+" "+$ip_new
?"- 190-" IF (len(@address)=0)
?"- 191-" $address="xxxxxxxxxxxx"
?"- 193-" ELSE
?"- 194-" $address=@address
?"- 197-" ENDIF
?"- 198-" $x=$x+" "+$address
?"- 200-" $user=""
?"- 201-" IF ($nt_mode="yes")
?"- 202-" $ikey="HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon"
?"- 203-" IF (ExistKey($ikey)=0)
?"- 204-" $user=ReadValue($ikey,"DefaultUserName")
?"- 205-" ENDIF
?"- 206-" ELSE
?"- 207-" $ikey="HKEY_LOCAL_MACHINE\System\CurrentControlSet\control"
?"- 208-" IF (ExistKey($ikey)=0)
?"- 209-" $user=ReadValue($ikey,"Current User")
?"- 210-" ENDIF
?"- 211-" ENDIF
?"- 212-" IF (len($user)=0)
?"- 213-" $user=@userid
?"- 214-" IF (len($user)=0)
?"- 215-" $user="~user"
?"- 216-" ENDIF
?"- 217-" ENDIF
?"- 218-" $x=$x+" "+$user
?"- 219-" $tmp_short=$tmp_short+" "+$user
?"- 221-" IF (len(@wksta)=0)
?"- 222-" $x=$x+" ~wksta"
?"- 223-" $tmp_short=$tmp_short+" ~wksta"
?"- 224-" ELSE
?"- 225-" $x=$x+" "+@wksta
?"- 226-" $tmp_short=$tmp_short+" "+@wksta
?"- 227-" ENDIF
?"- 228-" IF (len(@fullname)=0)
?"- 229-" IF (len(@comment)=0)
?"- 230-" $x=$x+" ('~fullname')"
?"- 231-" ELSE
?"- 232-" $x=$x+" ('~fullname'+'"+@comment+"')"
?"- 233-" ENDIF
?"- 234-" $tmp_short=$tmp_short+" '~fullname'"
?"- 235-" $fullname=$user
?"- 236-" ELSE
?"- 237-" IF (len(@comment)=0)
?"- 238-" $x=$x+" ('@fullname')"
?"- 239-" ELSE
?"- 240-" $x=$x+" ('"+@fullname+"'+'"+@comment+"')"
?"- 241-" ENDIF
?"- 242-" $tmp_short=$tmp_short+" '"+@fullname+"'"
?"- 243-" $fullname=$user
?"- 244-" ENDIF
?"- 246-" $admin_user="no"
?"- 247-" IF (INGROUP("Administrators")=1) OR (INGROUP("Administrators")=2)
?"- 248-" $admin_user="yes"
?"- 249-" ENDIF
?"- 250-" IF (INGROUP("Domain Admins")=1) OR (INGROUP("Domain Admins")=2)
?"- 251-" $admin_user="yes"
?"- 252-" ENDIF
?"- 254-" $tmp=$x
?"- 256-" $license="yes"
?"- 262-" $last_logon_message="Last logon by '"+$fullname+"' at "+LCASE(@day)+"
"+@mdayno+"-"+LCASE(substr(@month,1,3))+"-"+@year+"
; -------> Warning KIXSTRIP: 262 line incomplete "double quotation".

; -------> Warning KIXSTRIP: 262 line incompleted.

?"- 263-" "+@time
; -------> Warning KIXSTRIP: 263 line incomplete "double quotation".

; -------> Warning KIXSTRIP: 263 line incompleted.

?"- 264-" $last_workstation="Location pc '"+UCASE(@wksta)+"' of domain '"+UCASE($domain)+"'"
?"- 265-" $previous_logon_message="<unknown>"
?"- 266-" $previous_workstation="<unknown>"
?"- 268-" $filename=$user_drive+"\logon.lst"
?"- 269-" IF (exist($filename)=1)
?"- 270-" IF (setfileattr($filename,128)<>0)
?"- 271-" ENDIF
?"- 272-" $previous_logon_message=readprofilestring($filename,"last logon","user")
?"- 273-" $previous_workstation=readprofilestring($filename,"last logon","workstation")
?"- 274-" ENDIF
?"- 275-" IF (writeprofilestring($filename,"last logon","user",$last_logon_message)<>0)
?"- 276-" ? @serror
?"- 277-" ENDIF
?"- 278-" IF (writeprofilestring($filename,"last logon","workstation",$last_workstation)<>0)
?"- 279-" ? @serror
?"- 280-" ENDIF
?"- 281-" IF (setfileattr($filename,7)<>0)
?"- 282-" ? @serror
?"- 283-" ENDIF
?"- 285-" IF (exist($filename)=1)
?"- 286-" IF (len($previous_logon_message)=0)
?"- 287-" $previous_logon_message="<unknown>"
?"- 288-" ENDIF
?"- 289-" ENDIF
?"- 291-" IF ($previous_logon_message<>"<unknown>")
?"- 292-" $msg="Welcome to "+$logon_server+" network"+$lf
?"- 293-" $msg=$msg+$lf
?"- 294-" $msg=$msg+$lf
?"- 295-" $msg="Note: internal systems must be used only for con-"+$lf
?"- 296-" $msg=$msg+" ducting business, or for purpose authorized"+$lf
?"- 297-" $msg=$msg+" by management."+$lf
?"- 298-" $msg=$msg+$lf
?"- 299-" $msg=$msg+"Use is subject to audit at any time by management."+$lf
?"- 300-" $msg=$msg+$lf
?"- 301-" $msg=$msg+$lf
?"- 302-" $msg=$msg+$previous_logon_message+$lf
?"- 303-" IF ($admin_user="yes")
?"- 304-" $msg=$msg+$lf
?"- 305-" $msg=$msg+$previous_workstation
?"- 306-" ENDIF
?"- 308-" IF (MessageBox($msg,$logon_server,64,10)<>0)
?"- 309-" ? @serror
?"- 310-" ENDIF
?"- 311-" ENDIF
?"- 317-" :end_script
?"- 326-" $time_stop=@time
?"- 327-" IF ($nt_mode="yes")
?"- 328-" $log_info="Kixtart-LOG "+$prgrm_version+" script completed successfully"
?"- 329-" $log_info=$log_info+" for '"+LCASE($user)+"' "+UCASE($domain)
?"- 330-" $log_info=$log_info+" ("+$time_start+" - "+$time_stop+" - '"+$ip_new+"')"
?"- 331-" IF (len($fullname)>0)
?"- 332-" $log_info=$log_info+" '"+LCASE($fullname)+"'"
?"- 333-" $log_info=$log_info+" '"+$previous_logon_message+"'"
?"- 334-" $log_info=$log_info+" '"+$previous_workstation+"'"
?"- 335-" ENDIF
?"- 337-" IF logevent(0,1,$log_info,"","Kixtart LOG @kix"+"s")
?"- 338-" ENDIF
?"- 339-" ENDIF
?"- 340-" PLAY "0g500f60t"
?"- 341-" BREAK on
?"- 342-" FLUSHKB
?"- 345-" :end
?"- 346-" QUIT
;($begin)
;
; fri 16-mar-2001 10:31:54
;
;Warning KIXSTRIP: 2 lines are incompleted.
;Warning KIXSTRIP: some lines contains errors or possible errors.
; 2 line incomplete "double quotation".
; 2 line incompleted.
;Informative KIXSTRIP: 54 block_structures found.
;Informative KIXSTRIP: 3 labels found.
;Summary KIXSTRIP: CALL EXIT GOSUB GOTO QUIT RETURN RUN SHELL USE
;Informative KIXSTRIP: 1 CALL
;Informative KIXSTRIP: 1 GOTO
;Informative KIXSTRIP: 1 QUIT
;
;($end)
;($begin)
;
;Warning KIXSTRIP: 262, 263 line incomplete "double quotation".
;Warning KIXSTRIP: 262, 263 line incompleted.
;
;($end)


Remarks:

line 15 "goto lastuser" isn't necessary.
line 17 "CALL %0\..\Nav" change it to "Call %0\..\Nav.KIX".

Q: I do not use roaming profiles in my workplace, but for my testing account, I just set my home directory to z: which connects it to
the Profiles$ share on my server. Would I have to enter the User Profile column as well? or would that not make a difference?

A: The usage of roaming, mandatory or other profiles doesn't influence the script. The problem can be the usage of drive Z.
We suppose that another part of your logon process with map the specified drive.

Q: Are these changes enough? Why isn't anything
showing like what was the last previously logged on time, etc.
I have checked that the logon.lst file does not exist in the Profiles$ directory on the server, even though I have logged on twice. I
have also made sure that the Profiles$ directory I have created allows full control to everybody.
A: The changes are enough. For checking the correctness of rights we copy a simple file from our C-drive to this drive.

Q: There doesn't seem to be an error in the script, 'cos I don't see any red lines that say error.
A: It is possible that the colour will not be changed to red, but it is possible that the call "CALL %0\..\Nav" doesn't return to the
original script.
Another suggestion is to skip temporarily the Norton Antivirus update part by inserting as first line goto lastuser
I'll include a script here for reference. Hope someone can help me.

We hope that it helps you.
Greetings.

BTW:
- this answer was earlier posted by email
- first email reponse:

code:

Thanks for your reaction. A lot of things are written to kixtart.org topic

http://kixtart.org/board/Forum1/HTML/001067.html

We are running the script without integration in another script.
We had to change (if necessary) two kixtart variables:

$logon_server which can changed to message box header
$user_drive which must be changed to home directory of user. the file logon.lst in this home directory
will contain information about last logon.

The lines in the script are:

$logon_server="IT company"
$user_drive="s:" ; - variable used by calculation of possible missing "$user" value -

Possible problems can be:

* incorrect $user_drive setting.
* insufficient read/write rights for the user.
* some variables of other code are conflicting.
* some other statements are conflicting.

A way of checking your script is: running our tool kixstrip with option /debug.
During running the script it tells exactly which line are executed.
By running kixstrip you get to know of there are any problem.
A summary of your variables, functions, commands and macro's can be made with the tool kixref.exe.
Our advice is to run the logon.kix script with changes to the variables $user_drive and $logon_server first standalone.

When you have still problem please sent us a copy of your script.
So will we look at it too.


_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.053 seconds in which 0.038 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org