Exchange Online MFA PowerShell Execution Policy Error

If you try to run PowerShell script from Office 365, Exchange Online MFA PowerShell Console you receive the following error message.

Error Message

“Set-executionPolicy, Windows PowerShell updated your execution policy successfully, but the settings is overridden by a policy defined at a more specific scope..”

The reason, you are receiving this error is because the Exchange Online remote PowerShell session has a different Execution Policies configured and to run scripts that are stored on the local machine you need to adjust the policy.

To change, the Exchange Online remote shell policy, run the two commands below from the Exchange Online PowerShell console.

Set-ExecutionPolicy "unrestricted" -Scope Process -Confirm:$false
Set-ExecutionPolicy "Unrestricted" -Scope CurrentUser -Confirm:$false

After you run the commands, you can run your PowerShell script.