0

Copying from Github-

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("First Last")
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'

Not really well documentation on this issue so not sure what I can try.

Random Davis
  • 6,662
  • 4
  • 14
  • 24
mansmokes
  • 15
  • 2

0 Answers0