We have an Azure Automation Runbook that uses the Security and Compliance cmdlets that are in Exchange Online Management module to set retention policies for Teams. We currently have version 2.0.6 Preview 7 loaded in Azure Automation. The following code works with this version of the module:
$org = "<domain>"
$connection = get-automationconnection -name "AzureRunAsConnection"
connect-exchangeonline -CertificateThumbPrint $connection.CertificateThumbprint -AppID $connection.ApplicationId -Organization $org
Connect-IPPSSession -CertificateThumbPrint $connection.CertificateThumbprint -AppID $connection.ApplicationId -Organization $org
Without changing the code in the runbook, if I upgrade to v3.0.0 of the Exchange Online Management module, the code results in the following error:
Unable to load DLL 'IEFRAME.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) (There was an error connecting to an Azure Resource. Error: Unable to load DLL 'IEFRAME.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E))
What changed between version 2.0.6 preview 7 and version 3.0.0 that CBA would fail to work?
I would love to use the managed identity instead but connect-ippssession does not support managed ids yet??? If I rewrite connect-ippssession with my own function and change the call to connect-exchangeonline to managed ID, the security and compliance cmdlets work just fine. But that is for another QA.
Thanks!