Using Console
Using CLI
az login
.Step 2: Run the command az vm update
to update the virtual machine.Step 3: Add the --authentication-type all
parameter to the command.Step 4: Add the --admin-username <username>
and --admin-password <password>
parameters to specify the admin username and password.Step 5: Add the --set osProfile.windowsConfiguration.enableAutomaticUpdates=true
parameter to enable automatic updates.Step 6: Add the --set osProfile.windowsConfiguration.provisionVMAgent=true
parameter to provision the virtual machine agent.Step 7: Add the --set osProfile.windowsConfiguration.winRM.listeners.protocol=https
parameter to enable HTTPS protocol for WinRM listeners.Step 8: Add the --set osProfile.windowsConfiguration.winRM.listeners.certificateUrl=<certificate-url>
parameter to specify the certificate URL for WinRM listeners.Step 9: Add the --set osProfile.windowsConfiguration.winRM.listeners.certificateThumbprint=<certificate-thumbprint>
parameter to specify the certificate thumbprint for WinRM listeners.Step 10: Add the --set osProfile.windowsConfiguration.winRM.listeners.allowedOrigins=<allowed-origins>
parameter to specify the allowed origins for WinRM listeners.Step 11: Finally, run the command az vm update
with all the parameters mentioned above to remediate the misconfiguration “Enable Virtual Machine Access using Active Directory Authentication” in AZURE using AZURE CLI.Note: Replace <username>
, <password>
, <certificate-url>
, <certificate-thumbprint>
, and <allowed-origins>
with the actual values.Using Python
<domain_username>
and <domain_password>
with the Active Directory username and password you want to use for authentication.