You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for row in q.get_results():
print(row["Manager"],row["mail"], row["distinguishedName"], row["whenCreated"] , row["lastLogon"],row["accountExpires"],row["userPrincipalName"])
For some of the elements such as LastLogonDate, its return a COMObject instead of a date.
<COMObject > <COMObject >
Any help is appreciated
The text was updated successfully, but these errors were encountered:
Hello,
I am trying to pull a list of AD Group users that have logged in recently, and when their account expires.
See code snippet below:
import pyad.adquery
q = pyad.adquery.ADQuery()
q.execute_query(
attributes = ["distinguishedName", "mail", "whenCreated", "Manager", "lastLogon","accountExpires","userPrincipalName"],
where_clause = "objectClass = 'user'",
base_dn = "OU=users, DC=domain, DC=com"
)
for row in q.get_results():
print(row["Manager"],row["mail"], row["distinguishedName"], row["whenCreated"] , row["lastLogon"],row["accountExpires"],row["userPrincipalName"])
For some of the elements such as LastLogonDate, its return a COMObject instead of a date.
<COMObject > <COMObject >
Any help is appreciated
The text was updated successfully, but these errors were encountered: