Page 1 of 1 1
Topic Options
#42445 - 2003-07-03 10:49 PM Password Expiration Notice
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 Offline
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
#42447 - 2003-07-03 11:17 PM Re: Password Expiration Notice
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You might want to look at the use of SELECT CASE ENDSELECT, e.g.
code:
select
case $passwordage=$passwordnotice1
$rc=MessageBox($passwordtitle,'Your password will expire in 10 days.',64)
case $passwordage=$passwordnotice2
case $passwordage=$passwordnotice3
case $passwordage=$passwordnotice4
endselect

_________________________
There are two types of vessels, submarines and targets.

Top
#42448 - 2003-07-03 11:18 PM Re: Password Expiration Notice
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
may I ask why you do this?
if you have expiring passwords, your system will surely notify you.
_________________________
!

download KiXnet

Top
#42449 - 2003-07-04 12:16 AM Re: Password Expiration Notice
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Jooel is right.. Our system tells us 13 days out.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#42450 - 2003-07-04 12:25 AM Re: Password Expiration Notice
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Under policies there is an option for
Interactive logon: Prompt user to change password before expiration.

This can be set to any period you want.
It will notify the user EVERY time they logon until they either change it,
or it expires.

If you want it to be 10 days, set it for 10 days. By default it is 14 days.

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
1 registered (Allen) and 957 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.06 seconds in which 0.03 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