Gathering virtual machine guest OS information

Gathering virtual machine guest OS information

  • Comments 1

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

Leave a Comment
  • Please add 2 and 1 and type the answer here:
  • Post
  • 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....

Page 1 of 1 (1 items)