Vbscript Gather cluster information


I’ve created this script to plan a cluster migration, and needed to collect all information available to the purpose.

This script allows you to gather all the information about a cluster.

CONST ForAppending = 8
Dim objFSO, IputFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set InputFile = objFSO.OpenTextFile("C:\ClusterInfo.txt", ForAppending, True) ' you can change the location of output file
strComputer = "cluster name" ' change here the name of the cluster that you want to gather infromation
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\mscluster")
Set colItems = objWMIService.ExecQuery("Select * from MSCluster_Node") For Each objItem in colItems
inputFile.WriteLine "Build number: " & objItem.BuildNumber
inputFile.WriteLine "Caption: " & objItem.Caption
inputFile.WriteLine "Characteristics: " & objItem.Characteristics
inputFile.WriteLine "CSD version: " & objItem.CSDVersion
inputFile.WriteLine "Dedicated: " & objItem.Dedicated
inputFile.WriteLine "Description: " & objItem.Description
inputFile.WriteLine "Enable event log replication: " & objItem.EnableEventLogReplication
inputFile.WriteLine "Flags: " & objItem.Flags
inputFile.WriteLine "Identifying descriptions: " & objItem.IdentifyingDescriptions
inputFile.WriteLine "Initial load info: " & objItem.InitialLoadInfo
inputFile.WriteLine "Installation date: " & objItem.InstallDate
inputFile.WriteLine "Last load info: " & objItem.LastLoadInfo
inputFile.WriteLine "Major version: " & objItem.MajorVersion
inputFile.WriteLine "Minor version: " & objItem.MinorVersion
inputFile.WriteLine "Name: " & objItem.Name
inputFile.WriteLine "Name format: " & objItem.NameFormat
inputFile.WriteLine "Node highest version: " & objItem.NodeHighestVersion
inputFile.WriteLine "Node lowest version: " & objItem.NodeLowestVersion
inputFile.WriteLine "Other identifying info: " & objItem.OtherIdentifyingInfo
inputFile.WriteLine "Power state: " & objItem.PowerState
inputFile.WriteLine "Primary owner contact: " & objItem.PrimaryOwnerContact
inputFile.WriteLine "Primary owner name: " & objItem.PrimaryOwnerName
inputFile.WriteLine "Reset capability: " & objItem.ResetCapability
inputFile.WriteLine "Roles: " & objItem.Roles
inputFile.WriteLine "State: " & objItem.State
inputFile.WriteLine "Status: " & objItem.Status
inputFile.WriteLine Next On Error Resume Next Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\mscluster") Set colItems = objWMIService.ExecQuery("Select * from MSCluster_NetworkInterface") For Each objItem in colItems
inputFile.WriteLine "Adapter: " & objItem.Adapter
inputFile.WriteLine "Address: " & objItem.Address
inputFile.WriteLine "Availability: " & objItem.Availability
inputFile.WriteLine "Caption: " & objItem.Caption
inputFile.WriteLine "Characteristics: " & objItem.Characteristics
inputFile.WriteLine "Description: " & objItem.Description
inputFile.WriteLine "Device ID: " & objItem.DeviceID
inputFile.WriteLine "Flags: " & objItem.Flags
inputFile.WriteLine "Identifying descriptions: " & objItem.IdentifyingDescriptions
inputFile.WriteLine "Installation date: " & objItem.InstallDate
inputFile.WriteLine "Name: " & objItem.Name
inputFile.WriteLine "Network: " & objItem.Network
inputFile.WriteLine "Other identifying info: " & objItem.OtherIdentifyingInfo
inputFile.WriteLine "Power-on hours: " & objItem.PowerOnHours
inputFile.WriteLine "State: " & objItem.State
inputFile.WriteLine "Status: " & objItem.Status
inputFile.WriteLine "Status info: " & objItem.StatusInfo
inputFile.WriteLine "System name: " & objItem.SystemName
inputFile.WriteLine "Total power-on hours: " & objItem.TotalPowerOnHours
inputFile.WriteLine Next tsInputFile.Close

Hope that this information can be useful.

Advertisements

About rodvars
Been working in IT Services/Consulting for the past 15 years. My main areas of work are planning, development, managing and administration System infrastructures focusing on optimizing user processes, enforcing business security, performance enhancements, high availabilty and infrastucture scalability.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: