Forum Discussion

Gthankachan's avatar
Gthankachan
Copper Contributor
Apr 28, 2023

Can anyone give PowerShell Script that export signing or last login details of Azure AD user?

I need help to get PowerShell Script to display sign in logs or last logon details of Azure AD users( All users) as given below

 

 

 

    • Ajay_Joshi's avatar
      Ajay_Joshi
      Brass Contributor
      Hi Andres, appreciate you sharing your knowledge and this script, it's quite useful for people like us. I wanted to additionally ask for the Last Signin/login details specifically. We have been looking to get this field for sometime now but can't find it. A particular challenge here is that AAD Sign-in logs are mostly available for last 30 days so we would need that field to be blank for users who didn't sign-in in that period. That obviously means the last logon date was more than 30 days ago. So far, the only option available is of the last Mailbox sign-in date through the Get-MailboxStatistics command but we want it on User's sign-in basis and not for mailbox as all users don't have mailboxes. Thanks in advance.

Resources