The term ‘Connect-ExchangeOnline’ is not recognized

Created: 2023-04-13 11:28:15
Modified: 2023-09-18 11:26:19
Tags: Office 365 System Requirements Troubleshooting

When discovering or syncing to o365, you may find manually run processes works, but the process run via a scheduled task throws the following error:

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 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

Share this article:
Knowledgebase

Directory
  1. Directify - Self Service

  2. Mimic - Replication

  3. UnitySync - Sync
Password
  1. emPass - Sync
Obsolete
  1. Profiler
  2. SimpleSync