How to list all Azure AD / Entra ID cloud only users with no sign in information?

EnterpriseArchitect 6,041 Reputation points
2023-08-18T07:02:13.6766667+00:00

Hi All,

Assuming the Azure PowerShell is still current and not be replaced with the MSGraph PowerShell module, how can I retrieve the Azure cloud-only account with no Sign In Logs activity in the past 90 days or older?

Get-AzureADAuditSignInLogs -Filter "UserPrincipalName like '*@company.onmicrosoft.com'" -All $true

Thank you in advance.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,376 Reputation points
    2023-08-18T10:26:30.5166667+00:00

    Hi @EnterpriseArchitect

    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.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.