Forum Discussion
Bupeshkumar Rajendiran
Aug 12, 2018Copper Contributor
O365 last logon
I am trying to extract 0365 last-logon. is there is any other way other than mailboxstatistics cmdlet in powershell. This command doesnt help me. Things i have tried. 1. Search-UnifiedAuditLog -...
Robert Luck
Aug 13, 2018Iron Contributor
Hello Bupeshkumar Rajendiran,
Finding a last-logon using the audit log is quite challenging. If you go with the PowerShell then you need to retrieve all the data and compute the statistics by iterating the result or you may store the data in a database which you can run a query against. Also, note that you can find the last login information only if the user logged in the past 90 days as Microsoft only preserve the audit log for last 90 days by default. Preserving beyond this limit is also quite challenging.
I believe you are looking for a report like this. Instead of developing the solution on your own, the better way is to use the pre-built solution which takes care of preserving the data over the retention limit, timely sync, etc.