Do you use BGInfo?
If you do there is a script that you can add to BGInfo to display when the users' password will expire on their desktop:
Source: bginfo show days until password expires? - Spiceworks
On Error Resume Next
Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000
Const E_ADS_PROPERTY_NOT_FOUND = &h8000500D
Const ONE_HUNDRED_NANOSECOND = .000000100
Const SECONDS_IN_DAY = 86400
' Get UserName
Dim objNetwork, userName
Set objNetwork = CreateObject("WScript.Network")
userName = objNetwork.UserName
Set objUser = GetObject("LDAP://CN=" & userName & ",OU=Users,DC=domain,DC=local")
intUserAccountControl = objUser.Get("userAccountControl")
If intUserAccountControl And ADS_UF_DONT_EXPIRE_PASSWD Then
echo "The password does not expire."
dtmValue = objUser.PasswordLastChanged
If Err.Number = E_ADS_PROPERTY_NOT_FOUND Then
echo "The password has never been set."
intTimeInterval = Int(Now - dtmValue)
echo "The password was last set on " & _
DateValue(dtmValue) & " at " & TimeValue(dtmValue) & vbCrLf & _
"The difference between when the password was last" & vbCrLf & _
"set and today is " & intTimeInterval & " days"
Set objDomain = GetObject("LDAP://DC=domain,DC=local")
Set objMaxPwdAge = objDomain.Get("maxPwdAge")
If objMaxPwdAge.LowPart = 0 Then
Echo "The Maximum Password Age is set to 0 in the " & _
"domain. Therefore, the password does not expire."
dblMaxPwdNano = _
Abs(objMaxPwdAge.HighPart * 2^32 + objMaxPwdAge.LowPart)
dblMaxPwdSecs = dblMaxPwdNano * ONE_HUNDRED_NANOSECOND
dblMaxPwdDays = Int(dblMaxPwdSecs / SECONDS_IN_DAY)
echo "Maximum password age is " & dblMaxPwdDays & " days"
If intTimeInterval >= dblMaxPwdDays Then
echo "The password has expired."
echo "The password will expire on " & _
DateValue(dtmValue + dblMaxPwdDays) & " (" & _
Int((dtmValue + dblMaxPwdDays) - Now) & " days from today)."
I haven't go this to work yet as where the author states:
he does not explain where in the script those changes should be made [I do not clain to be adept at VBS and so this may take some time for me to get right]
...There's two places where you'll need to modify to match your running domain....
If there are any VBS experts out there who can indicate where I need to make the changes and what they should be I would be grateful.
As we already use BGInfo I think that this will be a good solution for us once it is working. Hopefully it will help you also.