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 ...
Ravi-MTC
Oct 10, 2019Copper Contributor
VasilMichevAlso is it possible to get a script that will run with a normal account as the account am trying does not need MFA?
VasilMichev
Oct 10, 2019MVP
Yeah, that's the line trying to load the MFA-enabled module. The cmdlets are available via the non-MFA ExO PowerShell as well, just remove this line and connect manually.
- Ravi-MTCOct 11, 2019Copper Contributor
VasilMichev Thanks for your help mate.
Removed the command for MFA and tried again, i get the error now when running command"$EXOSession = New-ExoPSSession -UserPrincipalName $UPN"
check attachment
Also for #Set admin UPN this will be my admin account used to run this command right?
$UPN = 'test@something.com'- VasilMichevOct 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-MTCOct 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 🙂