Jump to content
  • entries
    142
  • comments
    0
  • views
    87573

Classic Azure VM Details


proximagr

1136 views

 Share

<p>I was looking for a way to have a list with many details about VMs of Azure Classic deployment. Some of the details are VM Name, HostName, Service Name, IP address, Instance Size, Availability Set, Operating System, Disk Name (OS), SourceImageName (OS), MediaLink (OS), HostCaching (OS), Subnet, DataDisk Name, DataDisk HostCaching, DataDisk MediaLink, DataDisk Size.</p>
<p>I started with PowerShell ISE and some technet search and after a lot of test I created this script:</p><pre class="crayon-plain-tag">Add-AzureAccount
Select-AzureSubscription -SubscriptionId xxxxxxx-xxxxxxxx-xxxxxx-xxxxxx
$VMlist = ForEach ($VM in (Get-AzureVM))
{ Get-AzureOSDisk -VM $VM | Select @{Label="VM";Expression={$VM.Name}},`
@{Label="HostName";Expression={$VM.HostName}},`
@{Label="Service";Expression={$VM.ServiceName}},`
@{Label="IP";Expression={$VM.IpAddress}},`
@{Label="InstanceSize";Expression={$VM.InstanceSize}},`
@{Label="AvailabilitySet";Expression={$VM.AvailabilitySetName}},`
OS,DiskName,SourceImageName,MediaLink,HostCaching, `
@{Label="Subnet";Expression={(Get-AzureSubnet -VM $VM)}},`
@{Label="DataDiskName";Expression={(Get-AzureDataDisk -VM $VM).DiskName}},`
@{Label="DDHostCaching";Expression={(Get-AzureDataDisk -VM $VM).HostCaching}},`
@{Label="DDMediaLink";Expression={(Get-AzureDataDisk -VM $VM).MediaLink}},`
@{Label="DDSize";Expression={(Get-AzureDataDisk -VM $VM).LogicalDiskSizeInGB}}
}
$VMlist | Sort VM,SourceImageName | Export-CSV C:vms_alldata.csv -NoTypeInformation</pre><p>Just open the vms_alldata.csv with Excel, convert test to columns and insert table and voila:</p>
<p><a href="http://www.e-apostolidis.gr/wp-content/uploads/2016/05/allvms.jpg"><imgclass="alignnone wp-image-990 size-full" src="http://www.e-apostolidis.gr/wp-content/uploads/2016/05/allvms.jpg" alt="allvms" width="1017" height="58" srcset="http://www.e-apostolidis.gr/wp-content/uploads/2016/05/allvms.jpg 1017w, http://www.e-apostolidis.gr/wp-content/uploads/2016/05/allvms-300x17.jpg 300w, http://www.e-apostolidis.gr/wp-content/uploads/2016/05/allvms-768x44.jpg 768w, http://www.e-apostolidis.gr/wp-content/uploads/2016/05/allvms-660x38.jpg 660w" sizes="(max-width: 1017px) 100vw, 1017px" /></a></p>
<p><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fazure%2Fclassic-azure-vm-details%2F&linkname=Classic%20Azure%20VM%20Details"title="Email" rel="nofollow" target="_blank"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_button_print" href="http://www.addtoany.com/add_to/print?linkurl=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fazure%2Fclassic-azure-vm-details%2F&linkname=Classic%20Azure%20VM%20Details" title="Print" rel="nofollow" target="_blank"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/icons/print.png" width="16" height="16" alt="Print"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="https://www.addtoany.com/share#url=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fazure%2Fclassic-azure-vm-details%2F&title=Classic%20Azure%20VM%20Details" id="wpa2a_2"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a rel="nofollow" href="http://www.e-apostolidis.gr/microsoft/azure/classic-azure-vm-details/">Classic Azure VM Details</a> appeared first on <a rel="nofollow" href="http://www.e-apostolidis.gr">Proxima's IT Corner</a>.</p>



<a href="http://www.e-apostolidis.gr/microsoft/azure/classic-azure-vm-details/"class='bbc_url' rel='nofollow external'>Source</a>

 Share

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...