Recently had a project where we wanted to identify users created an automated process in the last day. This script gets the job done.
#Gather a list of recently created users #specify time that will be compared against -24 is the most recent 24 hours #you can use the option funtion addDays for a longer time period #Note that time from AzureAD is UTC $time = (get-date).ToUniversalTime().AddHours(-24) $users = Get-AzureADUser -All $newusers = New-Object Collections.Generic.List foreach ($u in $users) { # Write-Host $u.ExtensionProperty.createdDateTime If ([datetime]$u.ExtensionProperty.createdDateTime -gt $time) { $newusers.Add($u) } } Write-host "There are " $newusers.count " new users" $newusers