On Demand Migration tasks like account discovery or Email migration are failing with ""The term XXXXXXX is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again., Tenant : domain.com" or similar error.
This is caused by missing permissions to the Azure APPs ODM Deploy in the Tenants.
Please check and perform the following troubleshooting to ensure all is correctly assigned.
                              Quest On Demand - Migration - Full
                              Quest On Demand - Migration - Minimal
3. If the problem continues you will need to connect to the affected Exchange Admin Center > Roles > Admin Roles > Organization Management > Assigned and ensure the Exchange Administrator is a member. In case the membership is missing you will need to use Powershell to assign the Role.
4. If the problem continues ensure the Organization Management role has all the needed permissions to run the powershell cmdlets use by ODM. Connect via PowerShell and run the attached script that will identify if there are any missing permissions on the Organization Management Role.
Example: New-ManagementRoleAssignment -Role "Mail Recipient Creation" -SecurityGroup "Organization Management"
5. Ensure that the ExchangeServiceAdmins_-XXXXXXXXX role has all needed permissions assigned in the Exchange Online Admin portal: