List details about Azure Virtual Machines such as Instance Size, IP Address, PowerState etc

The following article will demonstrate how to gather details about your Azure VM’s via PowerShell commands.

First step is to verify you are in the correct Azure Subscription. To connect to the correct subscription you want to report on you can do the following:

PS C:\> Select-AzureSubscription

cmdlet Select-AzureSubscription at command pipeline position 1 Supply values for the following parameters: (Type !? for Help.) SubscriptionName: Subscription4

Now the commands you run will run against “subscription4″ instead of the default subscription. Substitute your subscription name for Subscription4 of course.

Once you are in the correct subscription you can run the following command. This will bring back the following values.

Name, IpAddress, DNSName, InstanceSize, PowerState

C:\> Get-AzureVM | Get-AzureVM | Format-List Name, IpAddress, DNSName, InstanceSize, PowerState > c:\files\servers.txt

Name : Server1
IpAddress : 10.1.2.3
DNSName : http://Server1.cloudapp.net/
InstanceSize : Medium
PowerState : Started

Name : Server2
IpAddress : 10.1.2.4
DNSName : http://Server2.cloudapp.net/
InstanceSize : Large
PowerState : Started

Name : Server3
IpAddress : 10.1.2.5
DNSName : http://Server3.cloudapp.net/
InstanceSize : ExtraLarge
PowerState : Started

Name : Server4
IpAddress : 10.1.2.6
DNSName : http://Server4.cloudapp.net/
InstanceSize : ExtraLarge
PowerState : Started

The entire list of values for this command are as follows. Meaning, after the format list part of the above command, you can specify any of these values.

DeploymentName
Name
Label
VM
InstanceStatus
IpAddress
InstanceStateDetails
PowerState
InstanceErrorCode
InstanceFaultDomain
InstanceName
InstanceUpgradeDomain
InstanceSize
AvailabilitySetName
DNSName
ServiceName
OperationDescription
OperationId
OperationStatus

One Response to List details about Azure Virtual Machines such as Instance Size, IP Address, PowerState etc

  1. Vivek says:

    One word for this—- Awesomeeeeeeeeeeeeeeeeee

Leave a Reply to Vivek Cancel reply

Your email address will not be published. Required fields are marked *