다음을 통해 공유


Azure VM : Run Command Feature

I am Happy and surprised to see, Microsoft commitments towards improvements of the services are quite amazing, I am using MS Azure services since when it is classic model (ASM) and it has very limited feature but when MS has started his “Resource Manager Journey”, It’s improving the lots of services  and adding new feature day on day.

I am a little bit surprised with this new Feature “Run Command” which is enabled in Azure VMs Operations properties ,it’s will provide the “Powershell to execute the command,  can enable the Administrator accounts and even more you can reset the password, set the remote ports” and many more which can’t be done through portal earlier.

Which will generally help to troubleshot the VMs related query?

Now you can easily get the IP configuration from the portal and enables lots of new below mention things. Below is the list of the commands.

Name Description

RunPowerShellScript

Executes a PowerShell script

EnableAdminAccount

Enable administrator account

EnableRemotePS

Enable remote PowerShell
IPConfig

List IP configuration

RDPSettings

Verify RDP Listener Settings

ResetAccountPassword

Reset built-in Administrator account password

ResetRDPCert

Restore RDP Authentication mode to defaults

SetRDPPort

Set Remote Desktop port

I am writing in my blogs how you can enable those features.

Available commands from the Azure Portal

Run the Powershell script.

  • Click on the VMs which you want to enable the Run Commands.
  • Co to Operations and select the Run Command.
  • Select the PowerShell script to Run.

  • Select the PowerShell Script
  • Please Write or Past the PowerShell script.
  • Run the Powershell Commands for the same.
  • You will get an output in “Black” Screen.

Enabling Admin Accounts.

If you missed or forget a user ID and password or required to enable the run command you can enable it from the portal.

  • Click on EnableAdminAccount
  • Select script
  • Click on Run, your admin account will be enabled.

Enable-RemotePS

 Enable-PSRemoting cmdlet helps the computer to receive Windows PowerShell remote commands.

  • Click on the RemotePS command
  • Run the Script
  • Then remote PS command will get enabled.

IP-Config details

Most of the cases if VMs are down due to some changes we are unable to track the change in that case you will get IPConfig/All details from this command.

  • Click on Run Command.
  • Click on IP config
  • Click on the script
  • Run the Script.

RDS Settings

If you want to what is your VMs RDP setting you can run this commandlets.

  • Click on Run Command.
  • Click on RDP Settings
  • Click on the script
  • Run the Script.

Reset Admin Accounts Passwords

If you forget your administrator user account password, then using this command you can reset the password.

  • Click on Run Command.
  • Click on ResetAccountPassword
  • Click on the script
  • Run the Script.

Reset RDcert

  • Click on Run Command.
  • Click on ResetRDcert
  • Click on the script
  • Run the Script.

Reset RDP Ports

If some has changed the RDP ports, then you can reset from the below commands.

  • Click on Run Command.
  • Click on ResetRDP Port
  • Click on the script
  • Run the Script.

Author Blogs: Azure4you