Forum Discussion
Help in running script to get inactive users
Might help if you tell us the errors you are running into. The script needs two modules, the MSOnline one, and the MFA-enabled Exchange module. Make sure those are installed before running it. And you also need to run it with account with sufficient permissions to query the audit logs.
VasilMichevAlso is it possible to get a script that will run with a normal account as the account am trying does not need MFA?
- VasilMichevOct 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.