Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript to return AD password expirations returning bad data

Status
Not open for further replies.

twbanks

Technical User
Nov 16, 2005
3
US
I've been using a script very similar to the one in thread329-1552035
for the last several months without error.

Suddenly, last week, the resulting password expirations are 48 days earlier than they should be. The value 48 is consistent. Looking at the users in ADUC, their passwords are set to what I think they ought to be (x+48), but the script still returns x.
 
Figured it out.
This part was looking at the domain of the account running the script rather than the domain that held the users I was searching for. Apparently the pwd policy for that domain had changed. After specifying the right domain, the numbers are correct.
Code:
Set objDomain = GetObject("LDAP://" & objADSystemInfo.DomainDNSName)
Set objMaxPwdAge = objDomain.Get("maxPwdAge")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top