Auto-Update The Installation of #HyperV Integration Services via #PowerShell

Hello Folks,

Recently I came across a project were I need to upgrade 6 Hyper-V Hosts from 2012 to 2012 R2.

As I mentioned in the previous post, we must update the Hyper-V Integration Component Services (ICS) for all Virtual Machines after the Hyper-V host is upgraded, and always remember to keep them up to date in Windows guests Operating Systems.

The Integration Services for Hyper-V are actually part of the Windows Server and Windows Client OSs (since the time of Windows Server 2008 R2/Windows 7).

The challenge is that I want to update the Integration Services for 40 Virtual Machines. As you know you can find the Hyper-V Integration Services in the settings of each virtual machine.

What happened when you select the Insert Integration Services Setup Disk action option for a VM? behind the scenes the C:\Windows\System32\vmguest.iso file is attached to the Virtual Machine. Either the setup.exe in the support\amd64 or support\x86 folder is run, depending on the architecture of the guest OS in the VM.

Now the logic behind the auto deployment of the Integration Services outside of the Hyper-V manager console, is to extract the content of the vmguest.iso file. This can be done now with Windows Server 2012, Windows 8 and above or with PowerShell.

Next we will share the extracted ISO image, and then call the setup.exe from within the Virtual Machine. The /quiet switch can be used with the setup.exe to make the installation in Unattended mode, but please note that the Virtual Machine will reboot after the installation is done. If you don’t want to restart the VM when the installation is completed, you need to add the /norestart switch, but obviously you need to restart the Virtual Machine later in order to have the Integration Services updated.

Ok, so having this explained, let’s jump into the automation now Smile 

And here you go:HV-ICS01

If none of the Virtual Machines required to be updated:HV-ICS02

Two notes to mention:

1- You need to have Administrative privilege in order to run the script.

2- All Virtual Machines must be running x64 OS.

Please bear in mind I am not a PowerShell Guru Just kidding, but nevertheless it has worked for me and I feel that it’s a much nicer than having to update the Integration Services manually for each VM from the UI, so that’s that.

A couple of areas that could definitely be improved though, would have to check the guest OS architecture x86 or x64 in the VM, and then depending on that would have to update the Hyper-V Integration Services, etc.

If you have more ideas and would like to add more options, please share in the comment below:

Hope this was helpful for you.

Enjoy your day!

Cheers,
/Charbel

About Charbel Nemnom 311 Articles
Charbel Nemnom is a Microsoft Cloud Consultant and Technical Evangelist, totally fan of the latest's IT platform solutions, accomplished hands-on technical professional with over 15 years of broad IT Infrastructure experience serving on and guiding technical teams to optimize performance of mission-critical enterprise systems. Excellent communicator adept at identifying business needs and bridging the gap between functional groups and technology to foster targeted and innovative IT project development. Well respected by peers through demonstrating passion for technology and performance improvement. Extensive practical knowledge of complex systems builds, network design and virtualization.

5 Comments

  1. Hi Charbel,

    How are you? After long time. I have completed Hyper-V Server + SCVMM 2012 R2 implementation and it is running stable since 2 years. I had multiple issues, but we have passed everything. Also, I have configured DR in Azure(ASR). Thanks for all the help and guidance .

    Today I need to update my integration service. However, i am unable to copy the script. Can you help me?

  2. please send me above script, also need help on looping task on each vm:

    Get-VM –ComputerName (Get-ClusterNode –Cluster clustername) | Get-VMProcessor | where {$_.CompatibilityForMigrationEnabled -eq $false} | select-object vmname,computername,CompatibilityForMigrationEnabled | stop-vm | Set-VMProcessor -CompatibilityForMigrationEnabled 1 | start-vm

Leave a Reply