Strange output of pwdLastSet

57 Views Asked by At

Some of AD accounts are inactive and their pwdLastSet is equal to 0. However, when I'm trying to calculate password age for accounts, this inactive accounts gave me a last possible date 1601-01-01 00:00:00+00:00

Here is how it looks like:


current_date = datetime.now(timezone.utc)
start_date = user_details[0].pwdLastSet.value 
if  start_date == 0:
    password_age = 'NULL'
else:
    password_age = current_date - start_date
    print(password_age)
0

There are 0 best solutions below