Can you verify that the account that runs the process on the server has access to the Microsoft.Online.SharePoint.PowerShell module? Login to the system as the user and run Get-Module Microsoft.Online.SharePoint.PowerShell -ListAvailable
If that doesn't return anything, add the module's installation folder to the user's PSModulePath environment variable.