Office 365: Find the User Created Date
Requirement: Find the created date of a user account in Office 365.
How to Find the Creation Date of an Office 365 User Account?
Knowing the creation date of a user’s Office 365 account can be very useful information. It can help you determine how long they have been using the service for auditing purposes. Fortunately, it is possible to find this information quickly and easily. Let’s take a look at how you can retrieve the creation date of an Office 365 user account.
Get the User Creation Date from Azure AD Admin Center
To find the creation date of a user in Microsoft 365, you can follow these steps:
- Sign in to the Azure AD admin center with your admin account at https://aad.portal.azure.com.
- In the left navigation, go to Users > Search and Select the name of the user whose creation date you want to find.
- Under the “Overview” tab, in the “Basic info” section, you’ll find the “Created date time” of the user.
Alternatively, you can use PowerShell to find the creation date of a user.
Finding the Creation Date of a User via PowerShell
Another quickest way to find out when an Office 365 user account was created is by using PowerShell. To do this, you’ll need to use the Get-AzureADUser
cmdlet from the Azure AD PowerShell module. This cmdlet retrieves a user object from Azure AD and includes the CreationDateTime
property, which represents the date and time the user was created.
Here is an example of how you can use the Get-AzureADUser cmdlet to get the creation date of a user:
# Import the Azure AD module
Import-Module AzureAD
# Parameter
$UserID = "Salaudeen@Crescent.com"
# Connect to Azure AD
Connect-AzureAD
# Get the user object for the user with the specified email address
$User = Get-AzureADUser -Filter "mail eq '$UserID'" -ErrorAction SilentlyContinue
# Get the user's creation date
Write-host $User.ExtensionProperty.createdDateTime
This will retrieve the user object for the user with the email address “Salaudeen@Crescent.com” and display the CreationDateTime
property, which represents the date and time that the user was created. To get the user creation date of all users and export to CSV, use the following:
# Import the Azure AD module
Import-Module AzureAD
# Connect to Azure AD
Connect-AzureAD
# Get the user object for the user with the specified email address
$Users = Get-AzureADUser -All:$true
$UserData = @()
# Iterate through each user
$Users | ForEach-Object {
Write-Host "Getting created date for" $_.UserPrincipalName
#Collect the user data
$UserData += New-Object PSObject -property $([ordered]@{
ObjectId = $_.ObjectId
DisplayName = $_.DisplayName
UserPrincipalName = $_.UserPrincipalName
CreatedDateTime = $_.ExtensionProperty.createdDateTime
})
}
#Export to CSV
$UserData
$UserData | Export-CSV "C:\Temp\UsersCreationDate.csv" -NoTypeInformation
This script will retrieve the list of users, iterates through each of them, collects the Created Date Time of the user along with other available properties, and finally exports it to a CSV file.
Keep in mind that you will need to have the Azure AD PowerShell module installed and have permission to access Azure AD in order to use the Get-AzureADUser
cmdlet. You can install the Azure AD PowerShell module by running the following command:
Install-Module AzureAD
For more information on working with Azure AD using PowerShell, you can refer to How to Connect to Azure AD using PowerShell?
Get all Microsoft 365 users created in the Last month
To get a list of all users created in the past month in Office 365, you can use the Azure Active Directory (AAD) PowerShell module. Here’s a sample script that demonstrates how to do this.
# Import the Azure AD module
Import-Module AzureAD
# Connect to Azure AD
Connect-AzureAD
# Calculate the date and time one month ago
$OneMonthAgo = (Get-Date).AddMonths(-1)
# Get a list of all users created in the past month
$Users = Get-AzureADUser -All:$true | Where-Object {[System.DateTime]$_.ExtensionProperty.createdDateTime -gt $OneMonthAgo}
$UserData = @()
# Iterate through each user
$Users | ForEach-Object {
Write-Host "Getting created date for" $_.UserPrincipalName
#Collect the user data
$UserData += New-Object PSObject -property $([ordered]@{
ObjectId = $_.ObjectId
DisplayName = $_.DisplayName
UserPrincipalName = $_.UserPrincipalName
CreatedDateTime = $_.ExtensionProperty.createdDateTime
})
}
#Export to CSV
$UserData
$UserData | Export-CSV "C:\Temp\UsersCreationDate.csv" -NoTypeInformation
First, this script connects to Azure AD using the Connect-AzureAD
cmdlet. It then gets the current date and time using the Get-Date
cmdlet, and calculates the date and time one month ago using the AddMonths
method. Next, it uses the Get-AzureADUser
cmdlet to get a list of all users in the Azure Active Directory, and filters the results using the Where-Object
cmdlet to only include users who were created after the date and time one month ago.
Finally, it collects the user details using an object array, selecting the DisplayName
, ObjectID
, UserPrincipalName
, and CreatedDateTime
properties and then exports the data to a CSV file.
Conclusion
As you can see, finding out when an Office 365 user account was created is a relatively simple process that doesn’t require any special skills or knowledge. It is possible to find the date a user was created in Office 365 using the Azure Active Directory (AAD) or PowerShell module. You can retrieve a list of users that meet certain criteria, such as being created within a specific time range. It should only take a few minutes to locate this important information about your users’ accounts.