Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Notify users to change their password before it get expired

Reply
Thread Tools Display Modes

Notify users to change their password before it get expired

 
 
Bashar Badr
Guest
Posts: n/a

 
      05-09-2005
Hi,
is there a script to check the password age for the user and send pop-up
message to him before his passwordget expired.
for example: i want a pop-up message to come to any user before 2 days from
his passoed expire date.

thanx
 
Reply With Quote
 
 
 
 
Torgeir Bakken \(MVP\)
Guest
Posts: n/a

 
      05-09-2005
Bashar Badr wrote:

> Hi,
> is there a script to check the password age for the user and
> send pop-up message to him before his passwordget expired.
> for example: i want a pop-up message to come to any user before
> 2 days from his passoed expire date.

Hi

Assuming AD domain:

How Long Until My Password Expires?
http://msdn.microsoft.com/library/en...ng09102002.asp


Or using the PasswordLastChanged property:

'--------------------8<----------------------

Const SEC_IN_DAY = 86400
Const ADS_UF_PASSWD_CANT_CHANGE = &H40
Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000

' Specify how many days before the dialog box will be shown
iExpireDayBeforePasswordExpireDialog = 2

Set oNetwork = CreateObject("Wscript.Network")
Set oADsSysInfo = CreateObject("ADSystemInfo")

sNetBIOSDomain = oNetwork.UserDomain

Set oDomainNT = GetObject("WinNT://" & sNetBIOSDomain)

'Get MaxPasswordAge from Active Directory
iMaxPwdAge = oDomainNT.Get("MaxPasswordAge")


' Retrieve password information for current user
sADsUser = oADsSysInfo.UserName

Set oUserLDAP = GetObject("LDAP://" & sADsUser)
lngFlag = oUserLDAP.Get("userAccountControl")
sPasswdLastChange = oUserLDAP.PasswordLastChanged

blnPwdExpire = True
If (lngFlag And ADS_UF_PASSWD_CANT_CHANGE) <> 0 Then
blnPwdExpire = False
End If
If (lngFlag And ADS_UF_DONT_EXPIRE_PASSWD) <> 0 Then
blnPwdExpire = False
End If

If blnPwdExpire = True Then
iMaxPasswdAgeValue = iMaxPwdAge / SEC_IN_DAY
'Calculate days to password expires
iDaysToPasswordExpires = Int((sPasswdLastChange + iMaxPasswdAgeValue) - Now)

If iDaysToPasswordExpires =< iExpireDayBeforePasswordExpireDialog Then
sInfoMessage = "Your Windows/Active Directory password will expire in " _
& iDaysToPasswordExpires & " day(s)."
'Display messagebox
MsgBox sInfoMessage, vbSystemModal+vbInformation, "Password Expire Check"
End If
End If

'--------------------8<----------------------


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scr...r/default.mspx
 
Reply With Quote
 
Jim Vierra
Guest
Posts: n/a

 
      05-09-2005
I believe you can turn on password reminders in GP.

--
Jim Vierra

"Bashar Badr" <> wrote in message
news:598577A1-6A55-4FF7-8E4F-...
> Hi,
> is there a script to check the password age for the user and send pop-up
> message to him before his passwordget expired.
> for example: i want a pop-up message to come to any user before 2 days
> from
> his passoed expire date.
>
> thanx



 
Reply With Quote
 
Corné Bogaarts
Guest
Posts: n/a

 
      05-09-2005
That doesn't help users that only connect to a website such as Outlook Web
Access.

On Mon, 9 May 2005 11:33:57 -0400, "Jim Vierra" <> wrote:

>I believe you can turn on password reminders in GP.


 
Reply With Quote
 
Jim Vierra
Guest
Posts: n/a

 
      05-09-2005
Torgeir also sent you a script link. See his post at:
news:%...
--
Jim Vierra

"Corné Bogaarts" <> wrote in message
news:...
> That doesn't help users that only connect to a website such as Outlook Web
> Access.
>
> On Mon, 9 May 2005 11:33:57 -0400, "Jim Vierra" <> wrote:
>
>>I believe you can turn on password reminders in GP.

>



 
Reply With Quote
 
Corné Bogaarts
Guest
Posts: n/a

 
      05-10-2005
No he didn't, he sent it to Bashar Badr.
Please reply to the correct message in the thread. Especially since you don't
include the original message in your answers.

On Mon, 9 May 2005 17:16:10 -0400, "Jim Vierra" <> wrote:

>Torgeir also sent you a script link. See his post at:
>news:%...


 
Reply With Quote
 
Jim Vierra
Guest
Posts: n/a

 
      05-10-2005
Hey - I gave you a link to the exact message in my last post and it IS in
this thread.

Anyway - sorry if I confused you. It was my intention to be helpful.
--
Jim Vierra

"Corné Bogaarts" <> wrote in message
news:...
> No he didn't, he sent it to Bashar Badr.
> Please reply to the correct message in the thread. Especially since you
> don't
> include the original message in your answers.
>
> On Mon, 9 May 2005 17:16:10 -0400, "Jim Vierra" <> wrote:
>
>>Torgeir also sent you a script link. See his post at:
>>news:%.. .

>



 
Reply With Quote
 
finny
Guest
Posts: n/a

 
      05-23-2005
Hi,
Also have a similar requirement.I visited the site u have given and tried
the code.I am working in asp.net . It is throwing some error. "Cannot create
ActiveX component"
Kindly tell me. Its very urgent

Regards
Finny

"Torgeir Bakken (MVP)" wrote:

> Bashar Badr wrote:
>
> > Hi,
> > is there a script to check the password age for the user and
> > send pop-up message to him before his passwordget expired.
> > for example: i want a pop-up message to come to any user before
> > 2 days from his passoed expire date.

> Hi
>
> Assuming AD domain:
>
> How Long Until My Password Expires?
> http://msdn.microsoft.com/library/en...ng09102002.asp
>
>
> Or using the PasswordLastChanged property:
>
> '--------------------8<----------------------
>
> Const SEC_IN_DAY = 86400
> Const ADS_UF_PASSWD_CANT_CHANGE = &H40
> Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000
>
> ' Specify how many days before the dialog box will be shown
> iExpireDayBeforePasswordExpireDialog = 2
>
> Set oNetwork = CreateObject("Wscript.Network")
> Set oADsSysInfo = CreateObject("ADSystemInfo")
>
> sNetBIOSDomain = oNetwork.UserDomain
>
> Set oDomainNT = GetObject("WinNT://" & sNetBIOSDomain)
>
> 'Get MaxPasswordAge from Active Directory
> iMaxPwdAge = oDomainNT.Get("MaxPasswordAge")
>
>
> ' Retrieve password information for current user
> sADsUser = oADsSysInfo.UserName
>
> Set oUserLDAP = GetObject("LDAP://" & sADsUser)
> lngFlag = oUserLDAP.Get("userAccountControl")
> sPasswdLastChange = oUserLDAP.PasswordLastChanged
>
> blnPwdExpire = True
> If (lngFlag And ADS_UF_PASSWD_CANT_CHANGE) <> 0 Then
> blnPwdExpire = False
> End If
> If (lngFlag And ADS_UF_DONT_EXPIRE_PASSWD) <> 0 Then
> blnPwdExpire = False
> End If
>
> If blnPwdExpire = True Then
> iMaxPasswdAgeValue = iMaxPwdAge / SEC_IN_DAY
> 'Calculate days to password expires
> iDaysToPasswordExpires = Int((sPasswdLastChange + iMaxPasswdAgeValue) - Now)
>
> If iDaysToPasswordExpires =< iExpireDayBeforePasswordExpireDialog Then
> sInfoMessage = "Your Windows/Active Directory password will expire in " _
> & iDaysToPasswordExpires & " day(s)."
> 'Display messagebox
> MsgBox sInfoMessage, vbSystemModal+vbInformation, "Password Expire Check"
> End If
> End If
>
> '--------------------8<----------------------
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scr...r/default.mspx
>

 
Reply With Quote
 
Junior Member
Join Date: Jun 2011
Posts: 2

 
      07-15-2011
We use Netwrix password expiration notifier. It sends reports that warn users of expirations so they can change their passwords before they expire.Password Expiration Notifier (Freeware Edition)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there an AD2003 tool collecting expired pwds from stale accounts and notify those users? Nick Dakoronias Active Directory 2 07-31-2009 02:16 PM
MS VPN Users and Expired Password Adam Active Directory 3 10-25-2006 04:32 PM
Admin password expired and can't change it Michael Windows Server 1 09-27-2006 01:50 AM
Notify of change password expired Emyeu Active Directory 7 10-12-2005 09:47 PM
Password change policy keep prompting password expired in _ days! Mitesh Patel Active Directory 0 09-07-2005 10:28 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59