web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / axatoz / How to turn on/off AX VM th...

How to turn on/off AX VM through Powershell

Hai Nguyen Profile Picture Hai Nguyen 266

First, you need to install Azure PowerShell

Go to the Azure Downloads page and click the link to install the Azure PowerShell cmdlets.

clip_image001

Step 1: Get-AzureVM to find out all your VMs hosted on Azure. In my case i have one VM for AX2012 which was deployed through LCS

image

Make sure to copy ServiceName and Name

image

Step 2: How to start

image

Syntax: Start-AzureVM -ServiceName “AX2012R3-Demo-Demo-da16992830bbf75a” -Name “DEMO-41e1aa3f1f”

Refresh Azure Portal > VM > Status , you will see eventually the status will become “Running”

image

image

Step 3: How to stop

image

Syntax: Stop-AzureVM -ServiceName “AX2012R3-Demo-Demo-da16992830bbf75a” -Name “DEMO-41e1aa3f1f” -Force

image

Bonus:

How to get RDP file

image

Syntax: Get-AzureRemoteDesktopFile -ServiceName “AX2012R3-Demo-Demo-da16992830bbf75a” -Name “DEMO-41e1aa3f1f” -LocalPath “c:\temp\AzureAX.rdp”

image

How to launch RDP from command line directly

image

Syntax: Get-AzureRemoteDesktopFile -ServiceName $serviceName -Name $vmName –Launch

A session will pop up and prompt to connect to the VM
image

How to delete a virtual machine

image

Syntax: Remove-AzureVM -ServiceName “AX2012R3-Demo-Demo-da16992830bbf75a” -Name “DEMO-41e1aa3f1f” –DeleteVHD

image



This was originally posted here.

Comments

*This post is locked for comments