Answered Get VS Host Info?

  • Friday, October 10, 2008 8:41 PM
     
     
    Need to get VS host info?
    tony soper

All Replies

  • Friday, October 10, 2008 8:41 PM
     
     Answered Has Code

    '***************************************************************
    '*
    '* Purpose:  pull host information from the virtual server
    '*
    '*  this script must be run on the VS host and stores its
    '*  information int the Temp folder off the root of the C drive
    '*
    '***************************************************************
    On Error Resume Next

    ' consant definitions
    const PrintMode = 0   'mode 0 = file; 1 = screen
    CONST path = "c:\temp\"

    ' variable definitions

    Set objVS = CreateObject("VirtualServer.Application")
    Set objHost = objVS.HostInfo

    print "Logical processor count: " & objHost.LogicalProcessorCount, PrintMode
    print  "Memory: " & objHost.Memory, PrintMode
    print  "Memory available: " & objHost.MemoryAvail, PrintMode
    print  "Memory available string: " & objHost.MemoryAvailString, PrintMode
    print  "Memory total string: " & objHost.MemoryTotalString, PrintMode
    print  "MMX: " & objHost.MMX, PrintMode
    print  "Operating system: " & objHost.OperatingSystem, PrintMode
    print  "OS major version: " & objHost.OSMajorVersion, PrintMode
    print  "OS minor version: " & objHost.OSMinorVersion, PrintMode
    print  "OS service pack string: " & objHost.OSServicePackString, PrintMode
    print  "OS version string: " & objHost.OSVersionString, PrintMode
    print  "Parallel port: " & objHost.ParallelPort, PrintMode
    print  "Physical processor count: " & objHost.PhysicalProcessorCount, PrintMode
    print  "Processor features string: " & objHost.ProcessorFeaturesString, PrintMode
    print  "Processor manufacturer string: " & _
        objHost.ProcessorManufacturerString, PrintMode
    print  "Processor speed: " & objHost.ProcessorSpeed, PrintMode
    print  "Processor speed string: " & objHost.ProcessorSpeedString, PrintMode
    print  "Processor version string: " & objHost.ProcessorVersionString, PrintMode
    print  "SSE: " & objHost.SSE, PrintMode
    print  "SSE2: " & objHost.SSE2, PrintMode
    print  "3DNow!: " & objHost.ThreeDNow, PrintMode
    print  "UTC time: " & objHost.UTCTime, PrintMode

    '==========================================================================
    '
    ' VBScript Source File
    '
    ' NAME: Print
    '
    ' AUTHOR: richardCarpenter , Microsoft Corp
    ' DATE  : 9/24/2008
    '
    ' INputs:  Virtual Machine Name
    '          Output string
    '          Mode = Screen = 1
    '                 File   = 0
    '
    ' COMMENT: this function prints either to screen/command line or file
    '
    '==========================================================================
    Private sub Print(strOutput, bMode)
    dim objFS, strOutFile
    dim OutFile
    dim OutputFile

       OutputFile = path & "VS_Host_Info.txt"

       if bMode = 1 then     'we are printing to the screen
          wscript.echo strOutput
       elseif bMode = 0 then 'we are printing to a file
          Set objFS = WScript.CreateObject("Scripting.FileSystemObject")
          Set OutFile = objFS.OpenTExtFile(OutputFile , 8,true)
          OutFile.writeline strOutput
          OutFile.close
       end if
    end sub


    tony soper
    • Marked As Answer by tonysoper_MSFT Friday, October 10, 2008 8:41 PM
    •