Warning: Undefined array key "rcommentid" in /var/www/busted.dk/public_html/blog/wp-content/plugins/wp-recaptcha/recaptcha.php on line 348

Warning: Undefined array key "rchash" in /var/www/busted.dk/public_html/blog/wp-content/plugins/wp-recaptcha/recaptcha.php on line 349
Find Entra ID user creation date with Powershell

Find and Export Entra ID User Creation Date with PowerShell

If you’re managing users in Microsoft Entra ID, you may need to find when an account was created, whether for reporting, audits, or tracking the user lifecycle. This information can help identify dormant accounts, confirm onboarding dates, or support compliance efforts. One efficient way to handle this is to find Entra ID user creation date with PowerShell, especially when working with larger directories.

Rather than clicking through the Entra portal, you can use PowerShell and Microsoft Graph to retrieve this data quickly. In this post, you’ll learn how to get the creation date for a single user or export a full list. It is a practical method for IT admins who need better insight into account history.

Step 1: Connect to Microsoft Graph

First, make sure the Microsoft.Graph PowerShell module is installed. If not, you can install it with:

Install-Module Microsoft.Graph -Scope CurrentUser

Then connect to Microsoft Graph:

Connect-MgGraph

You’ll be prompted to sign in with an account that has the necessary permissions.

Note on permissions
To retrieve user data, your account must have appropriate permissions in Microsoft Graph. For reading user creation dates, the User.Read.All permission is typically required. If you’re using delegated access, make sure your role or app registration includes this scope.

Step 2: Find Entra ID User Creation Date with PowerShell

To retrieve the creation date of a specific user, run:

Get-MgUser -UserId user@contoso.com | Select-Object CreatedDateTime,DisplayName

Example output:

CreatedDateTime       DisplayName
------------------- ----------------
2021-03-22T14:10:30Z Jane Smith

The CreatedDateTime field shows when the user account was created in Entra ID.

Export All Entra ID User Creation Dates with PowerShell

To list all users and export their creation dates to a CSV file, use:

Get-MgUser -All -Property CreatedDateTime,DisplayName |
Select-Object DisplayName,UserPrincipalName,CreatedDateTime |
Export-Csv -Path "UserCreationDates.csv" -NoTypeInformation -Encoding UTF8

This will generate a CSV file with the display name, username, and creation date for every user in your directory.

Optional: Filter users by creation date

Want to focus only on recent accounts? You can filter for users created within a specific time frame like this:

Get-MgUser -All -Property DisplayName,CreatedDateTime |
Where-Object { $_.CreatedDateTime -ge (Get-Date).AddDays(-30) } |
Select-Object DisplayName,CreatedDateTime

This example filters for users created in the last 30 days. Adjust the number to suit your needs.

Bonus: Export more user details

If you’re already exporting data, consider adding more attributes for reporting or documentation purposes:

Get-MgUser -All -Property DisplayName,UserPrincipalName,CreatedDateTime,AccountEnabled |
Select-Object DisplayName,UserPrincipalName,CreatedDateTime,AccountEnabled |
Export-Csv -Path "UserDetails.csv" -NoTypeInformation -Encoding UTF8

This gives you an overview that includes account status along with creation dates.

Final Note

PowerShell offers a fast and reliable way to extract Entra ID user creation date information. Whether you’re troubleshooting, auditing, or managing account lifecycles, having access to this data can simplify your work and improve visibility across your environment.

By using this method to find Entra ID user creation date with Powershell, you can streamline reporting and documentation. Exporting the results to a CSV file makes it easy to share or review the data.