Microsoft

AZ-800 practice question 128

Administering Windows Server Hybrid Core Infrastructure · free question 128 of 246

Question

You have an Azure subscription and a computer named Computer1 that runs Windows 11. From the Azure portal, you deploy a virtual machine named VM1 that runs Windows Server. You configure VM1 to use the default settings. You need to ensure that you can connect to VM1 by using PowerShell remoting. Which cmdlet should you run, and what should you use to run the cmdlet? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Explanation

Run from: Azure Cloud Shell. Enable-AzVMPSRemoting is an Azure PowerShell cmdlet that works against the VM as an Azure resource. It uses the Azure control plane (Run Command) to turn on remoting inside the guest and adds the network security group rule that allows WinRM traffic, so you run it from an Azure PowerShell session that is signed in to the subscription. Microsoft's documentation runs it from Azure Cloud Shell, which already has the Az modules and an authenticated session. A PowerShell session on VM1 is not the right place, because the cmdlet manages the VM from outside, and a VM deployed with the default settings does not allow inbound WinRM to start with. Cmdlet: Enable-AzVMPsRemoting. It is the only option that configures both the guest (the WinRM listener and firewall) and the Azure network path in one step. Enable-PSRemoting -Force only configures the computer it runs on and leaves the NSG closed. Enable-PSSessionConfiguration only re-enables session configuration endpoints that already exist on that computer.

Need the theory? Learn it free in the AZ-800 course on Godlike Academy

Practice the whole free set

AZ-800 is a free exam: all 300 questions with instant feedback, plus Learn and Exam modes and PDF export, free.