Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在尝试使用 pyad 访问活动目录用户属性时遇到问题。这是我的代码:
user = pyad.aduser.ADUser.from_cn("tuser") print user.get_attribute(lastLogonTimestamp")
这些是打印的属性:
C:\Users\tuser\Desktop\docb0t>python docb0t.py [<COMObject GetEx>]
我不知道如何从该对象中检索值。我该怎么做?
我遇到了同样的问题,经过一番挖掘后找到了答案。您需要通过 pyadutils.convert_datetime 函数运行该属性。
print pyadutils.convert_datetime(user.get_attribute('lastLogonTimeStamp', False))
三骷髅