Forum Discussion
TomWechsler
Jul 14, 2021MVP
Using PowerShell in Microsoft 365, find all users who have not logged in in the last 180 days!
Hi Azure / Microsoft365 friends,
In a recent project, I was allowed to take on the following task. Search for all users (active users, not deactivated accounts) who had not logged in in the...
Aldmor
May 16, 2023Copper Contributor
for some reason it doesn't work:
$loggedOnUsers = Search-UnifiedAuditLog -StartDate "01/04/2023 12:00:00 AM" -EndDate "16/05/2023 12:00:00 AM" -Operations UserLoggedIn, PasswordLogonInitialAuthUsingPassword, UserLoginFailed -ResultSize 5000
because it returns nulla
$loggedOnUsers = Search-UnifiedAuditLog -StartDate "01/04/2023 12:00:00 AM" -EndDate "16/05/2023 12:00:00 AM" -Operations UserLoggedIn, PasswordLogonInitialAuthUsingPassword, UserLoginFailed -ResultSize 5000
because it returns nulla