I am trying to retrieve createdDateTime of Azure AD Users along with their Name and email address.
I found below commands:
- To connect to Azure AD:
Connect-AzureAD
- To retrieve the list of AzureAD users:
Get-AzureADUser
- To retrieve specific attributes, I tried using below command:
Get-AzureADUser | Select-Object DisplayName, Mail, createdDateTime
It is returning name and email of users successfully. But createdDateTime field is always empty for all users. I don't know where the problem is.
After retrieving all these, I want to export data to a CSV file that contains info like user's displayName, mail and their createdDateTime.
Can anyone help me out with the script or any suggestions?