zakird / pyad

Python Active Directory Tools | *Not actively maintained*
http://zakird.github.io/pyad/
176 stars 72 forks source link

Date based attributes all return None. #142

Open p2pgirl opened 3 years ago

p2pgirl commented 3 years ago

When I try to adquery or pull an attribute that has a date involved (such as lastLogon, lastLogoff, or even a log off method... the attribute always comes up None. However other attributes seem to work. What am I doing wrong?

user1=aduser.ADUser.from_cn("Cinque Brown") date=user1.get_last_login() //comes back as nonetype

Traceback (most recent call last): File "<pyshell#80>", line 1, in date=user1.get_last_login() File "C:\Users\administrator.RESOURCECENTER\AppData\Local\Programs\Python\Python39\lib\site-packages\pyad\adobject.py", line 407, in get_last_login return pyadutils.convert_datetime(self.get_attribute('lastLogonTimestamp', False)) File "C:\Users\administrator.RESOURCECENTER\AppData\Local\Programs\Python\Python39\lib\site-packages\pyad\pyadutils.py", line 71, in convert_datetime high_part = int(adsi_time_com_obj.highpart) << 32 AttributeError: 'NoneType' object has no attribute 'highpart'

liamhoganson commented 1 year ago

I'm experiencing this same issue. Did you happen to solve it?