I need to calculate the password expiration date for users in Active Directory.
This is basically done by obtaining the domain maxPwdAge which is a 64 bit
value that represents how often the users password must be changed.
I also need to obtain the date that the user last changed his/her password from
AD which is stored as passwordLastChanged. This is another 64 bit time value.
MSDN states that the account password expiration date is determined by adding
the maxPwdAge to the account passwordLastChanged date to get the date the
password will expire.
Since the values stored by AD are 64 bit, the functions return 64 bit values.
Arithmetic is typically 32 but operations, but in this case I need to add these
two values using 64 bit arithmetic.
my $oDomain = Win32::OLE->GetObject("ldap://".$strDomain/);
my $maxPwdAge = $oDomain->Get("maxPwdAge"); # 64 bit value
my $objUser = Win32::OLE->GetObject("LDAP://" . $strUserDN);
my $objLastPasswordChanged = $objUser->Get("passwordLastChanged"); # 64 bit
value
This is the problem... how do the addition in 64 bit mode?
my $PasswordExpirationDate = $objLastPasswordChanged + $maxPwdAge;
Any advice or help would be appreciated.
Howard
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs