The 'Connect-MsolService' command was found in the module 'MSOnline', but the module could not be loaded
说明
Active Roles Synchronization Service throws the following error when running a PowerShell script with workflow.
'Error details: Synchronization steps aborted. Details: An exception has occurred while executing 'PowerShell script' script invocation exception
The 'Connect-MsolService' command was found in the module 'MSOnline', but the module could not be loaded. For more information, run 'Import-Module MSOnline'. Could not load file or assembly 'Microsoft.Data.Services.Client, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'file:///C:\Program Files\WindowsPowerShell\Modules\MSOnline\1.1.183.66\Microsoft.Data.Services.Client.dll' or one of its dependencies. The system cannot find the file specified.'
原因
MSOnline module is no longer supported in Active Roles and has been discontinued from Microsoft.
解决办法
The script used will need to be amended accordingly with the new module supported in Active Roles.