Welcome to MSDN Blogs Sign in | Join | Help

Gathering virtual machine guest OS information

Here is a simple script to display information about the guest OS of a running virtual machine:

Option Explicit

dim vs, vm

Set vs = CreateObject("VirtualServer.Application")

set vm = vs.FindVirtualMachine("a virtual machine")

'Display information about the GuestOS
wscript.echo "Guest OS Information:"
wscript.echo "====================="
wscript.echo "OSName                : " & vm.GuestOS.OSName
wscript.echo "AdditionsVersion      : " & vm.GuestOS.AdditionsVersion
wscript.echo "CanShutdown           : " & vm.GuestOS.CanShutdown 
wscript.echo "IsHeartbeating        : " & vm.GuestOS.IsHeartbeating
wscript.echo "HeartbeatPercentage   : " & vm.GuestOS.HeartbeatPercentage
wscript.echo "IsHostTimeSyncEnabled : " & vm.GuestOS.IsHostTimeSyncEnabled

As you can see it displays the guest OS name (e.g. Windows XP), the version of Virtual Machine Additions that is installed, whether the guest operating system can be shut down remotely, if a heartbeat is being reported (and if so how many heartbeats have been received) and finally if host time synchronization is enabled.

All of this information can only be accessed if the virtual machine is currently running, and has Virtual Machine Additions installed.  If you try to run the script on a virtual machine that is not running, or does not have Virtual Machine Additions installed, you will receive an exception error.

Cheers,
Ben

Published Thursday, January 18, 2007 10:36 PM by Virtual PC Guy

Comments

Friday, January 19, 2007 8:03 AM by VMblog.com - Virtualization Information

# Gathering virtual machine guest OS information in Microsoft Virtual Server

Ben Armstrong, the Virtual PC Guy, writes a simple script to display information about the guest OS of

Tuesday, January 30, 2007 3:11 AM by Virtual PC Guy's WebLog

# Querying guest operating system information with Powershell

I recently posted how to query guest operating system information using VBScript . It was pointed out

Thursday, February 01, 2007 1:28 PM by Ahmad

# re: Gathering virtual machine guest OS information

Hi there,

Well this is not the right place to be posting this.. But I wass know desperately If we can redirect the Screen output of the VPC to another HDC or So.. Im havin sumthing in Mind........ So any1 kind enuf plss tell me if there is atleast an undocumented way....

New Comments to this post are disabled
 
Page view tracker