#42445 - 2003-07-03 10:49 PM
Password Expiration Notice
|
Anonymous
Anonymous
Unregistered
|
I was wondering if someone could help me out here. I'm trying to create a script that will notify a user when their password is getting ready to expire however when I run the script I've created I get notified for everytime I have message box. Any suggestions will be greatly appreciated.
$maxpwage = 90 $passwordage = @PWAGE $passwordtitle = "Password Expiration Notice" $passwordnotice1 = 80 $passwordnotice2 = 85 $passwordnotice3 = 87 $passwordnotice4 = 89
:10DAYS If $passwordnotice1 = Val($passwordage) Goto DAYS5 Else MessageBox("$passwordtitle","Your password will expire in 10 days.",64) EndIf
:DAYS5 If $passwordnotice2 = Val($passwordage) Goto DAYS3 Else MessageBox("$passwordtitle","Your password will expire in 5 days.",64) EndIf
:DAYS3 If $passwordnotice3 = Val($passwordage) Goto DAYS1 Else MessageBox("$passwordtitle","Your password will expire in 3 days.",64) EndIf
:DAYS1 If $passwordnotice4 = Val($passwordage) Goto END Else MessageBox("$passwordtitle","Your password will expire in 1515 day.",64) EndIf
:END
|
|
Top
|
|
|
|
#42446 - 2003-07-03 11:17 PM
Re: Password Expiration Notice
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
hmmm, think the logic is a bit reversed ? probably might want:
code:
If $passwordnotice1 = Val($passwordage) MessageBox("$passwordtitle","Your password will expire in 10 days.",64) Else Goto DAYS5 EndIf
Or maybe use the SELECT-CASE-ENDSELECT construct ?
code:
Break On $maxpwage = 90 $passwordage = @PWAGE $passwordtitle = "Password Expiration Notice" $passwordnotice1 = 80 $passwordnotice2 = 85 $passwordnotice3 = 87 $passwordnotice4 = 89 Select Case $passwordnotice1 = Val($passwordage) $= MessageBox("$passwordtitle","Your password will expire in 10 days.",64) Case $passwordnotice2 = Val($passwordage) $= MessageBox("$passwordtitle","Your password will expire in 5 days.",64) Case $passwordnotice3 = Val($passwordage) $= MessageBox("$passwordtitle","Your password will expire in 3 days.",64) Case $passwordnotice4 = Val($passwordage) $= MessageBox("$passwordtitle","Your password will expire in 1515 day.",64) Case 1 EndSelect
-Shawn [ 03. July 2003, 23:17: Message edited by: Shawn ]
|
|
Top
|
|
|
|
#42449 - 2003-07-04 12:16 AM
Re: Password Expiration Notice
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Jooel is right.. Our system tells us 13 days out.
Kent
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1077 anonymous users online.
|
|
|