Python get list of o365 users through MS Graph. Missing infomtion

from O365 import Account

credentials = ('hidden', 'hidden')

# the default protocol will be Microsoft Graph

account = Account(credentials, auth_flow_type='credentials', tenant_id='hidden')

users_list=[]
directory = account.directory()
    
for user in directory.get_users():
    print(dir(user))

I am connected to O365 and can gather users. I would like to see the users last password change date but the class is returning a None type. is this a MS graph permissions error or is it now supported in this API. see the bellow result.

['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_base_url', '_build_date_time_time_zone', '_cc', '_cloud_data_key', '_endpoints', '_gk', '_parse_date_time_time_zone', '_parse_resource', 'about_me', 'account_enabled', 'age_group', 'assigned_licenses', 'assigned_plans', 'birthday', 'build_base_url', 'build_url', 'business_phones', 'city', 'company_name', 'con', 'consent_provided_for_minor', 'country', 'created', 'department', 'display_name', 'employee_id', 'fax_number', 'full_name', 'get_profile_photo', 'given_name', 'hire_date', 'im_addresses', 'interests', 'is_resource_account', 'job_title', 'last_password_change', 'legal_age_group_classification', 'license_assignment_states', 'mail', 'mail_nickname', 'mailbox_settings', 'main_resource', 'message_constructor', 'mobile_phone', 'my_site', 'new_message', 'new_query', 'object_id', 'office_location', 'other_mails', 'password_policies', 'password_profile', 'past_projects', 'postal_code', 'preferred_data_location', 'preferred_language', 'preferred_name', 'protocol', 'provisioned_plans', 'proxy_addresses', 'q', 'responsibilities', 'schools', 'set_base_url', 'show_in_address_list', 'sign_in_sessions_valid_from', 'skills', 'state', 'street_address', 'surname', 'type', 'update_profile_photo', 'usage_location', 'user_principal_name', 'user_type']

Back to Top