Forum Discussion
JakobRohde
Sep 22, 2017Iron Contributor
List all users' last login date
Is it possible, using PowerShell, to list all AAD users' last login date (no matter how they logged in)? I have found a couple of scripts that check the last mailbox login, but that is not what we ne...
Kevin_Morgan
Dec 19, 2022Iron Contributor
The Microsoft Graph API now supports the resource property signInActivity in users end-point, this resource exposes the lastSignInDateTime property which shows the last time a user made a successful sign-in. Fetching signInActivity property requires an Azure AD Premium P1/P2 license and the AuditLog.Read.All permission. The following request retrieves user details along with signInActivity property.
#GET Request
https://graph.microsoft.com/beta/users?$select=displayName,signInActivity
You can refer the below post to know more details about how to find and export Last login date for all Azure AD Users using PowerShell.
- https://morgantechspace.com/2021/09/find-last-login-date-for-all-azure-ad-users-using-powershell.html
kclowes1035
Jun 16, 2023Copper Contributor
Is it possible to to get a last activity date for only guest users? I have about 25k that I need to cleanup and need to determine if they have logged on in the past 90days or more.
thanks
Kevin