The term ‘Connect-ExchangeOnline’ is not recognized
Created: 2023-04-13 11:28:15Modified: 2023-12-06 16:46:11
Tags: Office 365 System Requirements Troubleshooting
Possible causes of this error:
1. Please review Special Office 365 System Requirements to ensure your UnitySync version, EXO and Powershell are the latest and greatest versions.
2. If the problem persists, it may be due to which user was logged in when EXO was installed. Your connection may work when run via shell.exe but not via the UI (or vise versa).
The term 'Connect-ExchangeOnline' is not
recognized as a name of a cmdlet, function, script file, or executable program.
In the full output example below, notice the logging output reads: exo version=(null)
This may indicates scheduled task’s Run As account has not been enabled to run Exchange On line.
To resolve this problem:
Option 1:
Uninstall and re install using -Scope AllUsers
See steps#4 and #5 in the Requirements KB.
Option 2:
Run the following command (one time) As the user that is configured in Run As in the scheduled task.
Install-Module -Name ExchangeOnlineManagement
For reference, below is an example of the full error logging.
Starting Powershell process : 04/13/23 11:21:28
Check Lock : 04/13/23 11:21:28
*************************** Powershell Environment *****
exo version=(null)
powershell version=7.3.2
********************************************************
Check Lock : 04/13/23 11:21:37
Powershell Error Crit | The term 'Connect-ExchangeOnline' is not
recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
Powershell Err Msg | No Output
Run Summary : 04/13/23 11:21:39
Run Time | 12 seconds
Error Summary : 04/13/23 11:21:39
Powershell Error | 1
Fatal Error | 1
See Also:
CommandNotFoundException: The term ‘Get-MailUser’ is not recognized