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...
Marc Beaudoin
Apr 28, 2023Copper Contributor
It seems I get the exact opposite of the result I expected. Instead of a list of users who did not logged in in the last 180 days, I get all the users who did. Then again the code seems to be doing exactly date : get a list of all users between $startDate (today - 180 days) and $endDate (today) for the operation "UserLoggedIn".
Am I missing something?
Am I missing something?
- rellek74Dec 13, 2023Copper Contributor
Marc BeaudoinI think you want to change -"NotContains" to "Contains"