Obtaining the Date a Password Expires
Based on the previous subtasks, we can now calculate the date and time a user's
password will expire. Listing 4,
WhenPwdExpires.js, is a script that takes a user account name as a command-line
argument and displays when that account s password will expire. I decided to
use JScript because the JScript Date object stores all date and time values
as a number of milliseconds, in Coordinated Universal Time (aka UTC or GMT),
since midnight, January 1, 1970. For illustration purposes, I wrote an equivalent
VBScript version, Web Listing 4,
which you can download from the Windows Scripting Solutions Web site. If you
run both versions, you'll notice that the VBScript version can report different
expiration times than the JScript version because VBScript date calculations
are not locale-independent. . . .
cheahhw December 14, 2006 (Article Rating: