O.K. I have extracted informations from Kent's post
Password expiration for a service account
to calculate the days left before the password expires. Even though I don't understand the language or code [Big Grin]
code:
$ldomain = @domain
$lstrusername = "@username"
;$userobj = GetObject("LDAP://cn=ntdoc,ou=Users,ou=mybusinessOU,ou=cala,dc=MyCompany,dc=com")
$userobj = GetObject("WinNT://$LDomain/$lstrUserName")
$pwexpire = $userobj.passwordexpirationdate
?"UserName: " + $userobj.name
?"UserPasswordExpires: " + $pwexpire


$tt = SPLIT($pwexpire," ")
$mdy = SPLIT($tt[0],"/")
$expiredatearray = $mdy[2],$mdy[0],$mdy[1]
$currentdatearray = "@YEAR","@MONTHNO","@MDAYNO"


FUNCTION CalcDayofYear($ymdarray) ; Only works on non-millenium years after 2000.
$calendar = 31,28,31,30,31,30,31,31,30,31,30,31
IF VAL($ymdarray[0]) & 1 $ly = 0 ; leap year calculations
ELSE
IF (Val($ymdarray[0])/2) & 1 $ly = 0
ELSE
$ly = 1
ENDIF
ENDIF
$calendar[1] = $calendar[1] + $ly
$mdays = 0
FOR $m = 0 TO (Val($ymdarray[1]) -2)
$mdays = $mdays + $calendar[$m]
NEXT
$calcdayofyear = $mdays + $ymdarray[2]
ENDFUNCTION

$diffyears = VAL($expiredatearray[0]) - VAL($currentdatearray[0])
IF $diffyears > 0
$yearstodays = 0
FOR $countyear = VAL($currentdatearray[0]) TO (VAL($expiredatearray[0])-1)
$acountyear = $countyear,"12","31"
$yearstodays = $yearstodays + CalcDayofYear($acountyear)
NEXT
ENDIF

$daystoexpire = CalcDayofYear($expiredatearray) - CalcDayofYear($currentdatearray) + $yearstodays
?"Number of Days till password expires: " + $daystoexpire

Can someone show me how to extract the user name from a text file and feed it into the code above?
example text file:
usera userb userc userd
usere userf userg userh
etc.....

Thanks for everyone's help so far.