Click here to Skip to main content
15,925,661 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralBluetooth Programming... Pin
Jamal Abdul Nasir2-Feb-10 7:42
Jamal Abdul Nasir2-Feb-10 7:42 
GeneralRe: Bluetooth Programming... Pin
Richard MacCutchan2-Feb-10 8:42
mveRichard MacCutchan2-Feb-10 8:42 
QuestionWindows logon password reminder Pin
John Deeran2-Feb-10 7:37
John Deeran2-Feb-10 7:37 
AnswerRe: Windows logon password reminder Pin
DaveAuld2-Feb-10 7:43
professionalDaveAuld2-Feb-10 7:43 
GeneralRe: Windows logon password reminder Pin
John Deeran2-Feb-10 7:48
John Deeran2-Feb-10 7:48 
AnswerRe: Windows logon password reminder Pin
DaveAuld2-Feb-10 7:47
professionalDaveAuld2-Feb-10 7:47 
GeneralRe: Windows logon password reminder Pin
John Deeran2-Feb-10 7:51
John Deeran2-Feb-10 7:51 
GeneralRe: Windows logon password reminder Pin
DaveAuld2-Feb-10 8:02
professionalDaveAuld2-Feb-10 8:02 
I don't think a server is required, i just tried this and it told me my account has a maximum password age of 0 so does not expire;

1) Create a text document

2) add the code below and save

3) rename the file password.vbs

double click the file

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

Set objADSystemInfo = CreateObject("ADSystemInfo")              ' LINE 8
Set objUser = GetObject("LDAP://" & objADSystemInfo.UserName)   ' LINE 9

intUserAccountControl = objUser.Get("userAccountControl")
If intUserAccountControl And ADS_UF_DONT_EXPIRE_PASSWD Then
    WScript.Echo "The password does not expire."
    WScript.Quit
Else
    dtmValue = objUser.PasswordLastChanged
    If Err.Number = E_ADS_PROPERTY_NOT_FOUND Then
        WScript.Echo "The password has never been set."
        WScript.Quit
    Else
        intTimeInterval = Int(Now - dtmValue)
        WScript.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"
    End If

    Set objDomain = GetObject("LDAP://" & objADSystemInfo.DomainDNSName)
    Set objMaxPwdAge = objDomain.Get("maxPwdAge")

    If objMaxPwdAge.LowPart = 0 Then
        WScript.Echo "The Maximum Password Age is set to 0 in the " & _
                     "domain. Therefore, the password does not expire."
        WScript.Quit
    Else
        dblMaxPwdNano = _
            Abs(objMaxPwdAge.HighPart * 2^32 + objMaxPwdAge.LowPart)
        dblMaxPwdSecs = dblMaxPwdNano * ONE_HUNDRED_NANOSECOND
        dblMaxPwdDays = Int(dblMaxPwdSecs / SECONDS_IN_DAY)
        WScript.Echo "Maximum password age is " & dblMaxPwdDays & " days"

        If intTimeInterval >= dblMaxPwdDays Then
            WScript.Echo "The password has expired."
        Else
            WScript.Echo "The password will expire on " & _
              DateValue(dtmValue + dblMaxPwdDays) & " (" & _
              Int((dtmValue + dblMaxPwdDays) - Now) & " days from today)."
        End If
    End If
End If


Dave

Don't forget to vote on messages!
Find Me On: Web|Facebook|Twitter|LinkedIn
Waving? dave.m.auld[at]googlewave.com

GeneralRe: Windows logon password reminder Pin
John Deeran2-Feb-10 8:59
John Deeran2-Feb-10 8:59 
GeneralRe: Windows logon password reminder Pin
DaveAuld2-Feb-10 9:13
professionalDaveAuld2-Feb-10 9:13 
GeneralRe: Windows logon password reminder Pin
John Deeran2-Feb-10 9:32
John Deeran2-Feb-10 9:32 
QuestionControl Focus on Key Press Pin
eddieangel2-Feb-10 6:55
eddieangel2-Feb-10 6:55 
AnswerRe: Control Focus on Key Press Pin
Eddy Vluggen2-Feb-10 7:01
professionalEddy Vluggen2-Feb-10 7:01 
GeneralRe: Control Focus on Key Press Pin
eddieangel2-Feb-10 7:06
eddieangel2-Feb-10 7:06 
QuestionHi I am new to VB08 Pin
Taku Kawamoto2-Feb-10 5:58
Taku Kawamoto2-Feb-10 5:58 
AnswerRe: Hi I am new to VB08 Pin
Jay Royall2-Feb-10 6:08
Jay Royall2-Feb-10 6:08 
GeneralRe: Hi I am new to VB08 Pin
Taku Kawamoto2-Feb-10 6:21
Taku Kawamoto2-Feb-10 6:21 
GeneralRe: Hi I am new to VB08 Pin
Eddy Vluggen2-Feb-10 6:28
professionalEddy Vluggen2-Feb-10 6:28 
GeneralRe: Hi I am new to VB08 Pin
Taku Kawamoto2-Feb-10 6:36
Taku Kawamoto2-Feb-10 6:36 
GeneralRe: Hi I am new to VB08 Pin
Eddy Vluggen2-Feb-10 6:58
professionalEddy Vluggen2-Feb-10 6:58 
GeneralRe: Hi I am new to VB08 Pin
Taku Kawamoto2-Feb-10 7:15
Taku Kawamoto2-Feb-10 7:15 
GeneralRe: Hi I am new to VB08 Pin
Eddy Vluggen2-Feb-10 8:48
professionalEddy Vluggen2-Feb-10 8:48 
GeneralRe: Hi I am new to VB08 Pin
Jay Royall2-Feb-10 8:48
Jay Royall2-Feb-10 8:48 
AnswerRe: Hi I am new to VB08 Pin
DaveAuld2-Feb-10 6:14
professionalDaveAuld2-Feb-10 6:14 
GeneralRe: Hi I am new to VB08 Pin
Taku Kawamoto2-Feb-10 6:23
Taku Kawamoto2-Feb-10 6:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.