Perform an Azure Virtual Machine (VM) inventory with PowerShell

To generate quickly an overview of all the Virtual Machines (VMs) in an Azure subscription I made a PowerShell script that uses the Azure Az PowerShell module. This script will do an inventory of all VMs in a subscription.

The following VM information is displayed per subscription:

  • Name
  • PowerState
  • Region
  • Resource Group
  • VM Size
  • CPU Cores
  • Memory (MB)
  • License Type
  • Operating System
  • Offer
  • SKU
  • Publisher
  • VM Generation
  • VM Agent version
  • OS Name
  • OS Version
  • NIC Name
  • VNet
  • Private IP address
  • Public IP address
  • OS disk name
  • OS disk size (GB)
  • OS storage type
  • OS disk caching
  • Data disks count
  • Data disks names
  • Admin username
  • If boot diagnostics is enabled
  • Boot diagnostics storage account
  • Tags
  • The time the VM was created

The output will be displayed in the PowerShell console, to a PowerShell GridView output, and saved to a delimited CSV file.
The “azurevm-inventory.ps1” script can be found on my GitHub repo, link.

VMware, Microsoft and Starwind software updates

Last weeks a lots of software updates and new releases  are published. Here’s an overview of some of them:


VMware vSphere 4.1 Update 1

A new update for vSphere 4.1 is released. Here are the ESX(i) and vCenter improvements:

VMware ESX(i) 4.1  Update 1 improvements:

  • Enablement of Trusted Execution Technology (TXT) — ESXi 4.1 Update 1 can be configured to boot with Intel Trusted Execution Technology (TXT). This boot option can protect ESXi in some cases where system binaries are corrupted or have been tampered with. TXT is currently available on Intel Xeon processor 5600 series servers. For more information, see KB 1033811.
  • Improvement in scalability — ESXi 4.1 Update 1 supports up to 160 logical processors.
  • Support for additional guest operating systems — ESXi 4.1 Update 1 provides support for RHEL 6, RHEL 5.6, SLES 11 SP1 for VMware, Ubuntu 10.10, and Solaris 10 Update 9 guest operating systems. For a complete list of guest operating systems supported in this release, see the VMware Compatibility Guide.
  • Inclusion of additional drivers — ESXi 4.1 Update 1 includes the 3ware SCSI and Neterion vxge drivers. For earlier releases, these drivers are only available as separate downloads

The release notes can be found here.

VMware vCenter Server 4.1 Update 1 improvements:

  • Additional Guest Operating System Customization Support: vCenter Server now supports customization of the following guest operating systems:
    • Windows 7 SP1 (x32 and x64)
    • Windows Server 2008 R2 SP1 (x32 and x64)
    • RHEL 6.0 (x32 and x64)
    • RHEL5.5 (x32 and x64)
  • Additional vCenter Server Database Support: vCenter Server now supports the following databases:
    • Microsoft SQL Server 2008 R2
    • Microsoft SQL Server 2005 SP3
    • Oracle 11g Standard/Enterprise Release 2, or later,  (x32 and x64)
    • IBM DB2 9.7.2 Express C (x32 and x64)
    • IBM DB2 9.7.2 Enterprise (x32 and x64)
      For more information about using IBM DB2 – 9.7.2 database with vCenter Server 4.1 Update 1, see
      KB 1033201.

The release notes can be found here.

vSphere 4.1 Update 1 can be downloaded here.

VMware Data Recovery (vDR)

There is NO new version of vDR but it is now included  in the standard edition of vSphere since vSphere 4.1 Update 1. You can compare the vSphere versions here. For people who have who already bought vSphere standard and have a current subscription are able to download the vDR.

VMware ESX 3.0.3 patches

A new VMware ESX 3.0.3 patches are released . More information on these patches can be found in the following links:

The ESX 3.0.3 patches can be downloaded here.

VMware vCloud Director 1.0.1

New features are support for vSphere 4.1 Update 1, complies with Internationalization I18N Level 1 and IP Translation for Organization Networks support. The release notes can be found here.

vCenter Server Heartbeat 6.3 Update 1

The following enhancements  (Note: The features available depend on the version of vCenter Server installed) are available in this release:

  • Enhanced passive server management capabilities — A new deployment option allows the passive server to be managed and monitored remotely, this includes receiving file level antivirus updates. This option is only available for:
    • vCenter 4.0 U1 and its updates, 4.1 and its updates
    • Remote SQL Server 2005, 2008 onl

Please refer to install documentation for detailed requirements and install procedure specifically around DNS and changes required to Active Directory during installation.

  • Secure Client Server Communications — vCenter Server Heartbeat now provides secure client server communications with SSL Encryption using a 2048-bit key.
  • Support for View Composer — This release of VMware vCenter Server Heartbeat now provides support for View Composer v2.5

The vCenter Server Heartbeat 6.3 Update 1 release notes can be found here and downloaded  here.

VMware vCenter Site Recovery Manager 4.1.1 

VMware SRM 4.1.1 in a maintenance release. It has bugfixes and supports VMware vSphere 4.1 Update 1. Before installing VMware SRM 4.1.1 you need to update the vCenter server to 4.1 Update 1.  The release notes can be found here an be downloaded here. 


System Center Virtual Machine Manager 2008 R2 (SCVMM)

Microsoft has published a KB with the recommend hotfixes when performing P2V conversions by using SCVMM R2.

Windows Server 2008 R2 / Windows 7 SP1

On Technet and MSDN SP1 for Windows 2008 R2 and Windows 7 is released. SP1 has a lot of patches and bug fixes. Two new features are memory compression (Hyper-V) and Remote FX (Remote Desktop Services).


Starwind iSCSI SAN 5.6

A new version  of the  Starwind iSCSI SAN 5.6 is released. The Starwind iSCSI SAN  software converts a Windows bases server into a fail-safe, highly available iSCSI SAN. This release has the following improvements:

  • Event Log – Improve your storage management and tracking of system state with new event viewer 
  • Event notifications – Be aware of every single event by e-mail, records to Windows Event Log, records to text files 
  • Experimental version of inline block level Deduplication plugin 
  • Management Console multilevel improvements

Starwind offers a free NFR license valid for 6 months for MCP, MVP and VCP certified people. Request the  NFR here. The installation and configuration is very simple. Within a couple of minutes you have an working iSCSI SAN. it support Microsoft Hyper-V R2 Live migration (SCP-3 persistent reservations) and VMware vSphere clustering with DRS, HA and VMotion.


Test Microsoft Hyper-V R2 server on your laptop with Virtual Hard Disk (VHD)

When you want to test some Microsoft Hyper-V R2 stuff it’s handy to do that on your laptop. I test a lot stuff on my laptop equipped with Microsoft Windows 7, 8GB RAM and VMware Workstation. Installing Microsoft Hyper-V R2 for example in VMware Workstation is possible, but it is not possible to start any Virtual Machines (VMs). Microsoft Hyper-V requires a processor with Intel-VT or AMD-V with the No-Execute (NX) feature. In VMware Workstation the virtual CPU has no VT.

So how could I test Microsoft Hyper-V R2 and start VMs on my laptop? The solution is by using Virtual Hard Disks (VHDs).

Microsoft Windows 7 and Microsoft Windows 2008 R2 provides native support for Virtual Hard Disks (VHD). With Windows 7 (Enterprise and Ultimate editions) and Windows 2008 R2 (All versions except Windows 2008 R2 Foundation) you can create, configure and boot from VHD.

Here’s how to create, install and boot the VHD equipped with Microsoft WIndows 2008 R2 (so you could install the Microsoft Hyper-V role) in Microsoft Windows 7.

Step 1 Create a VHD using Disk Management

  • In Microsoft Windows 7 open Disk Management (diskmgmt.msc)
  • From the Action menu choose ‘Create VHD’
  • Select the location to store the VHD disk file and choose a VHD size. For the best performance use a fixed size.

2010-12-02 11h14_54

  • Initialize the VHD disk and assign a drive letter, a name and format the disk. In this example the VHD has drive letter G.

2010-12-02 11h13_30

Step 2 Transfer the image to the VHD

  • Mount the ISO image of Windows 2008 R2 (available for MSDN and TechNet subscribers). The ISO contains multiple images of different versions of Windows 2008 R2 and Windows 7. Here’s a list with the corresponding index number and the WIM images (found in the Install.wim).


Operating System Edition


Windows 7 Enterprise


Windows 7 Ultimate


Windows Server 2008 R2 Standard (Full Installation)


Windows Server 2008 R2 Standard (Server Core Installation)


Windows Server 2008 R2 Enterprise (Full Installation)


Windows Server 2008 R2 Enterprise (Server Core Installation)


Windows Server 2008 R2 Datacenter (Full Installation)


Windows Server 2008 R2 Datacenter (Server Core Installation)


Windows Web Server 2008 R2 (Full Installation)


Windows Web Server 2008 R2 (Server Core Installation)

Now we need to apply he WIM image to the VHD partition by  using the  ‘Install-WindowsImage.ps1’ PowerShell script. This Powershell script does the following:

The Install-WindowsImage PowerShell script uses the wimgapi.dll in Windows 7 or Windows Server 2008 R2 to apply a Windows image in a .wim file to a specified location. The script can be used to apply a Windows 7 or Windows Server 2008 R2 .wim image to a Virtual Hard Disk (VHD) used for native VHD boot or to boot in a Hyper-V virtual machine.

  • Download the ‘Install-WindowsImage’ PowerShell script here.
  • Open PowerShell and and use the following syntax to apply the image to the VHD.:
  • .\Install-WindowsImage.ps1 –WIM  <CDROMDriveLetter\sources\install.wim> -Apply -Index WIMimagenumber –Destination <VHD Drive>


.\Install-WindowsImage.ps1 -WIM Z:\sources\install.wim -Apply -Index 3 -Destination G:

  • The WIM image is now applying to the VHD. This can take up to 15 minutes.

Step 3 Prepare the VHD image for native boot

  • Open the command prompt (RUN as Administrator)
  • Create a new Boot Configuration Data (BCD) entry for native boot using the following syntax:

g:\Windows\System32\bcdboot g:\Windows

  • Using the command bcdedit command you can see the new boot entry pointing to the VHD image

2010-12-02 12h50_02

  • To change the default boot options use the bcdedit –v command to list the associated GUID numbers. Use the bcdedit  / default  {GUID} command to set the default boot config. A easier option is to use the MSCONFIG command to set the default boot entry and the timeout.


When restarting Microsoft Windows 7, there is an extra option for booting the  Windows 2008 R2 server OS and your able to install the Microsoft Hyper-V R2 role.

More information can be found in the  Microsoft Windows 2008 R2 Getting Started with Virtual Hard Disks document.