1

I'm using pyad to manipulate AD users in python. I retrieve and use most of user attributes without problem, but when I retrieve accountExpires with:

exp_date = aduser.get_attribute('accountExpires',False)

exp_date is a COMObject GetEx. accountExpires must be an int64 and I have no idea how to retrieve a long from this comobject.

Any help?

laalto
  • 150,114
  • 66
  • 286
  • 303
  • Can you post the whole code for accessing AD with python? I need to do nearly the same, but i can't find any good documentation. – 0xAffe Nov 22 '13 at 08:19
  • possible duplicate of [problems accessing object \[\] using python pyad](http://stackoverflow.com/questions/21520859/problems-accessing-object-comobject-getex-using-python-pyad) – Matthew Green Aug 11 '14 at 14:13

1 Answers1

1

Use the pyadutils module from pyad:

from pyad import pyadutils

...

exp_date = aduser.get_attribute('accountExpires',False)
print pyadutils.convert_datetime
fdgfdgfd
  • 11
  • 1