RSS

How to turn on/off AX VM through Powershell

27 Apr

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

Advertisements
 
Leave a comment

Posted by on April 27, 2015 in Development

 

Tags: , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: