Page 1 of 1 1
Topic Options
#62346 - 2002-01-23 05:12 PM Oldie But Goodie
Anonymous
Unregistered


Here's a snippet of code from my login script. All it does is check the password age.


;********************************************
;Name of Program: Pwage.kix
;Original program written: 11/12/00
;Author: Dan Drass
;Company Name: BRTRC
;Purpose: Check Password age
;
;Comment: You can edit and/or distribute this program freely
;
;********************************************


;------------------Max Password age is 90 days-------------------


$x3=10
$Pwd=@PWAGE
CLS

$MaxPw=@MAXPWAGE
cls


$x2=($MaxPw - 10)
CLS


$x4=($MaxPw - $Pwd)

Select
Case ($Pwd < $x2)

sleep 2


$null=writeprofilestring("c:\@wksta.txt","@wksta","@wksta"+chr(44)+"PWage" , "$Pwd")
CLS
Sleep 1
Case ($Pwd = $x2)
Goto Mess1
Case 2
Goto Mess1
sleep 2
EndSelect

:Mess1
CLS
Select
Case ($Pwd < $MaxPw)
$null=writeprofilestring("c:\@wksta.txt","@wksta","@wksta"+chr(44)+"PWage", "$Pwd")
?"Your Password expires in $x4 days"
sleep 2
cls
?" Processing info......wait...."
sleep 2
CLS
Case $Pwd = $MaxPw
CLS
?"Password Expires Today"
sleep 1

;---------Replace Admin with your Admin username----------------
SendMessage("Admin" , @USERID + " Password on: @wksta is due to expire in: $x4 days")
cls

sleep 2
CLS
Case 1
;---------Replace Admin with your Admin username----------------
SendMessage("Admin" , @USERID + " PassWrd Routine Error on: @wksta at @Time")
sleep 3
ENDSELECT

I'm sure the brainiacs can do better. But this program has worked so well that I refuse to change it.

Cheers

Top
#62347 - 2002-01-23 06:31 PM Re: Oldie But Goodie
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
A brainiac? nah, just too much free time

I believe this will do the same as your script:

code:

$AdminAccount='Admin' ; Change this to your own administrative accountname

If @PWAGE < @MAXPWAGE
$nul=writeprofilestring('c:\@wksta.txt','@wksta','@wksta'+chr(44)+'PWage' , '@PWAGE')
EndIf

CLS

Select
Case @PWAGE < @MAXPWAGE - 10
; More then 10 days away from password expiration.
; Do Nothing
Case @PWAGE < @MAXPWAGE
? 'Your Password expires in ' @MAXPWAGE-@PWAGE ' days'
Sleep 2
? " Processing info......wait...."
Sleep 2
Case @PWAGE = @MAXPWAGE
? 'Password Expires Today'
Sleep 2
$nul=SendMessage($AdminAccount , @USERID + ' Password on: @wksta expires today.')
Case 1
$nul=SendMessage($AdminAccount , @USERID + " PassWrd Routine Error on: @wksta at @Time")
EndSelect

CLS


_________________________
The Code is out there

Top
Page 1 of 1 1


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

Who's Online
1 registered (Allen) and 957 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.05 seconds in which 0.026 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