/bundles/itninjaweb/img/Breadcrumb_cap_w.png
Hi all.

I am new here at ITNinja and would need your help with scripting issue:

I have been requested to deploy the latest version of VirtualBox to customer computers (about 100 Win7 PCs) via SCCM.
These computers already have VirtualBox installed.
The customer asked if the installation script could safely shutdown all open VirtualBox machines before the updating starts and
this way avoid any possible data loss.

I tried to check VBoxManage commands from http://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvm but not sure how this could be done.

My guess is that the script should first list all currently running virtual machines and store this information to a some file.
Then this information (machine name / identifier) should be used with a command that closes running virtual machines one at the time.

Does this make any sense :) Or is there some other way to do this?

Thanks in advance.


Answer Summary:
Cancel
0 Comments   [ - ] Hide Comments

Comments

Please log in to comment

Answer Chosen by the Author


Answers

1
Firstly, I don't think as SCCM admin you should be managing users VMs, if they are using a VM then they fall into the Dev category and are grown up enough to manage their own VMs pre upgrade. Its basicly like me asking you to do my job cos Im a lazy git.

What you should do is use the command to list running VMs then halt the deployment if it finds any running VMs, leave it up to the owner of the VM to shut them down. Thinking about using PSDeploy as they can toast user notifications to users etc.

Good luck!

PS if you want to do this is powershell.
  1. List the running VMs and pump that into an array object.
    Bash the array around if you need ie to split the name and UUID.
  2. Loop the object to shut them down.
  3. Check that all VMs are down then upgrade.


Answered 11/02/2016 by: rileyz
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity

Answers