Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have over 10 hyper-v images that I use for testing various projects. Some I use often some less so.

It is a lot of work starting each of the machines individually to run windows update.

I was wondering if there is a powershell script that could spin up each of the machines, run windows update on it and then close it down again?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

If your VMs only include recent (Vista or later) Windows system, you don't need to actually start them to apply updates; you can do it directly to the offline .VHD files, by mounting them and using the dism.exe offline servicing tool; dism.exe has several features, one of which is the ability to apply patches to an offline Windows image or VHD file.

This very nice script should be able to automatically mount a VHD file, apply some updates to it and unmount it; I've not personally tested it, but looks like it should work:

http://gallery.technet.microsoft.com/scriptcenter/839ee6f0-196f-4ed7-ac55-8e753c5d5ebe

share|improve this answer
add comment

Not that I am aware of. This functionality is built into SCVMM, a non-free produce MS sells.

You might be able to do some sort of homebrew script (if I remember tomorrow I've got scripts for doing some other maintenance similar to this and will post them).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.