Forum Discussion
Ravi-MTC
Oct 10, 2019Copper Contributor
Help in running script to get inactive users
Hi Friends, I want to get a list of inactive users for last 30 days as recommended in Secure Score. Secure score tells me to run this script. however when I run it i get errors. can someone tell ...
VasilMichev
Oct 11, 2019MVP
Well don't run it, that again requires the MFA-enabled module. Remove all "connectivity" cmdlets and connect manually, then run the rest.
Ravi-MTC
Oct 11, 2019Copper Contributor
just tried your suggestion, the script ran successfully but I got all the users in the output instead of just the ones that had not logged in the last 90 days. Am I still missing something?
If you dont mind can you please edit the script with the relevant commands to run it including commands to connecting manually?
I have zero knowledge of powershell 🙂
- VasilMichevOct 11, 2019MVP
It's basically two simple cmdlets, there's not much to modify. But make sure you are connected to Exchange Online in order to get the list of active users via the Search-UnifiedAuditLog cmdlet. Here are the steps to connect just in case: https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps
- Ravi-MTCOct 18, 2019Copper Contributor
Microsoft support just confirmed that the script does give proper output. VasilMichev