Azure AD PowerShell is being deprecated soon, I recommend you to use the latest MS Graph PowerShell.
You can retrieve Azure users with no sign-in activity in the past 90 days or earlier by filtering on the lastSignInDateTime
property.
Import-Module Microsoft.Graph.Users
Get-MgUser -Filter "signInActivity/lastSignInDateTime le 2023-05-18T00:00:00Z"
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.