azureautomation / runbooks

Sample Automation runbooks
MIT License
150 stars 128 forks source link

Cannot use script on Server Core when MFA is enabled. #71

Open danielniccoli opened 3 years ago

danielniccoli commented 3 years ago

Cannot use script on Server Core when MFA is enabled.

PS C:\Users\admin> New-OnPremiseHybridWorker.ps1 @NewOnPremiseHybridWorkerParameters
Importing necessary modules...
     Successfully installed version 5.2.0 of Az...
Pulling Azure account credentials...
Connecting with the Following Parameters
WARNING: Unable to acquire token for tenant 'organizations'
WARNING: Please run 'Connect-AzAccount -DeviceCode' if browser is not supported in this session.
Connect-AzAccount : InteractiveBrowserCredential authentication failed: Unable to load DLL 'IEFRAME.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
At C:\Program Files\WindowsPowerShell\Scripts\New-OnPremiseHybridWorker.ps1:237 char:12
+ $Account = Connect-AzAccount @paramsplat
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Connect-AzAccount], AuthenticationFailedException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand

PS C:\Users\admin>