I am trying to export all users data including last login date. I am following this article:

<https://morgantechspace.com/2021/09/find-last-login-date-for-all-azure-ad-users-using-powershell.html>

By using this call:
<https://graph.microsoft.com/beta/users?$select=displayName,signInActivity>

PS:

```
$Url = "https://login.microsoftonline.com/$TenantName/oauth2/v2.0/token"

# Add System.Web for urlencode
Add-Type -AssemblyName System.Web

# Create body
$Body = @{
    client_id = $AppId
    client_secret = $AppSecret
    scope = $Scope
    grant_type = 'client_credentials'
}

# Splat the parameters for Invoke-Restmethod for cleaner code
$PostSplat = @{
    ContentType = 'application/x-www-form-urlencoded'
    Method = 'POST'
    # Create string by joining bodylist with '&'
    Body = $Body
    Uri = $Url
}

# Request the token!
$Request = Invoke-RestMethod @PostSplat

$ApiUrl = "https://graph.microsoft.com/beta/users?$select=displayName,signInActivity"

$Header = @{
    Authorization = "$($Request.token_type) $($Request.access_token)"
}

While ($ApiUrl -ne $Null) #Perform pagination if next page link (odata.nextlink) returned.
{
    # Fetch all security alerts
    $SecurityAlertsRequest = Invoke-RestMethod -Uri $ApiUrl -Headers $Header -Method Get -ContentType "application/json"

    $SecurityAlerts = $SecurityAlertsRequest.Value

    foreach($User in $SecurityAlerts){
         if($User.signInActivity.lastSignInDateTime) { 

            $test = [DateTime]$User.signInActivity.lastSignInDateTime 

    } Else {$null}

    }

    $ApiUrl=$SecurityAlertsRequest.'@odata.nextlink'
}

$SecurityAlerts

```

I connect via an app reg:
[![enter image description here](https://i.stack.imgur.com/B8bJo.png)](https://i.stack.imgur.com/B8bJo.png)

However signInActivity is always null for all users. Is it not possible to get all users with graph API including last signin?