Forum Discussion
Gthankachan
Apr 28, 2023Copper Contributor
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
- Andres-BohrenSteel Contributor
Hi Gthankachan
I've blogged about that Topic. Check out this
https://blog.icewolf.ch/archive/2023/01/26/analyze-azuread-signin-logs-with-powershell.aspx
Regards
Andres
- Ajay_JoshiBrass ContributorHi 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.