Contact Info

Crumbtrail

ActiveXperts.com » Administration » Scripts » WMI » jscript sample

Win32_PerfFormattedData_VmTaskManagerStats jscript sample code

The foundations for Manageability in Windows is Windows Management Instrumentation (WMI; formerly WBEM) and WMI extensions for Windows Driver Model (WDM).

ActiveXperts Network Monitor provides the ability to build monitor check routines based on WMI. ActiveXperts has collected more than a hundred WMI samples. You can use these samples as a base for new check routines you can write yourself. The Win32_PerfFormattedData_VmTaskManagerStats WMI class can be used in ActiveXperts Network Monitor to monitor your servers.


Sample Code

var strComputer = ".";

var objWMIService = GetObject("winmgmts:\\\\" + strComputer + "\\root\\CIMV2");
var colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PerfFormattedData_VmTaskManagerStats_HyperVTaskManagerDetail", "WQL");

var enumItems = new Enumerator(colItems);

for (; !enumItems.atEnd(); enumItems.moveNext()) {
	var objItem = enumItems.item();
	WScript.Echo("AddResourcesVirtualMachineTasksCompleted: " + objItem.AddResourcesVirtualMachineTasksCompleted);
	WScript.Echo("AddResourcesVirtualMachineTasksinProgress: " + objItem.AddResourcesVirtualMachineTasksinProgress);
	WScript.Echo("AddResourcesVirtualMachineTasksRecentTime: " + objItem.AddResourcesVirtualMachineTasksRecentTime);
	WScript.Echo("ApplySnapshotVirtualMachineTasksCompleted: " + objItem.ApplySnapshotVirtualMachineTasksCompleted);
	WScript.Echo("ApplySnapshotVirtualMachineTasksinProgress: " + objItem.ApplySnapshotVirtualMachineTasksinProgress);
	WScript.Echo("ApplySnapshotVirtualMachineTasksRecentTime: " + objItem.ApplySnapshotVirtualMachineTasksRecentTime);
	WScript.Echo("Caption: " + objItem.Caption);
	WScript.Echo("CloneVirtualMachineTasksCompleted: " + objItem.CloneVirtualMachineTasksCompleted);
	WScript.Echo("CloneVirtualMachineTasksinProgress: " + objItem.CloneVirtualMachineTasksinProgress);
	WScript.Echo("CloneVirtualMachineTasksRecentTime: " + objItem.CloneVirtualMachineTasksRecentTime);
	WScript.Echo("CreateVSSSnapshotSetTasksCompleted: " + objItem.CreateVSSSnapshotSetTasksCompleted);
	WScript.Echo("CreateVSSSnapshotSetTasksinProgress: " + objItem.CreateVSSSnapshotSetTasksinProgress);
	WScript.Echo("CreateVSSSnapshotSetTasksRecentTime: " + objItem.CreateVSSSnapshotSetTasksRecentTime);
	WScript.Echo("DefineVirtualMachineTasksCompleted: " + objItem.DefineVirtualMachineTasksCompleted);
	WScript.Echo("DefineVirtualMachineTasksinProgress: " + objItem.DefineVirtualMachineTasksinProgress);
	WScript.Echo("DefineVirtualMachineTasksRecentTime: " + objItem.DefineVirtualMachineTasksRecentTime);
	WScript.Echo("Description: " + objItem.Description);
	WScript.Echo("DestroySnapshotVirtualMachineTasksCompleted: " + objItem.DestroySnapshotVirtualMachineTasksCompleted);
	WScript.Echo("DestroySnapshotVirtualMachineTasksinProgress: " + objItem.DestroySnapshotVirtualMachineTasksinProgress);
	WScript.Echo("DestroySnapshotVirtualMachineTasksRecentTime: " + objItem.DestroySnapshotVirtualMachineTasksRecentTime);
	WScript.Echo("DestroyVirtualMachineTasksCompleted: " + objItem.DestroyVirtualMachineTasksCompleted);
	WScript.Echo("DestroyVirtualMachineTasksinProgress: " + objItem.DestroyVirtualMachineTasksinProgress);
	WScript.Echo("DestroyVirtualMachineTasksRecentTime: " + objItem.DestroyVirtualMachineTasksRecentTime);
	WScript.Echo("ExportVirtualMachineTasksCompleted: " + objItem.ExportVirtualMachineTasksCompleted);
	WScript.Echo("ExportVirtualMachineTasksinProgress: " + objItem.ExportVirtualMachineTasksinProgress);
	WScript.Echo("ExportVirtualMachineTasksRecentTime: " + objItem.ExportVirtualMachineTasksRecentTime);
	WScript.Echo("Frequency_Object: " + objItem.Frequency_Object);
	WScript.Echo("Frequency_PerfTime: " + objItem.Frequency_PerfTime);
	WScript.Echo("Frequency_Sys100NS: " + objItem.Frequency_Sys100NS);
	WScript.Echo("ImportVirtualMachineTasksCompleted: " + objItem.ImportVirtualMachineTasksCompleted);
	WScript.Echo("ImportVirtualMachineTasksinProgress: " + objItem.ImportVirtualMachineTasksinProgress);
	WScript.Echo("ImportVirtualMachineTasksRecentTime: " + objItem.ImportVirtualMachineTasksRecentTime);
	WScript.Echo("MergeDiskTasksCompleted: " + objItem.MergeDiskTasksCompleted);
	WScript.Echo("MergeDiskTasksinProgress: " + objItem.MergeDiskTasksinProgress);
	WScript.Echo("MergeDiskTasksRecentTime: " + objItem.MergeDiskTasksRecentTime);
	WScript.Echo("MigrateVirtualMachineTasksCompleted: " + objItem.MigrateVirtualMachineTasksCompleted);
	WScript.Echo("MigrateVirtualMachineTasksinProgress: " + objItem.MigrateVirtualMachineTasksinProgress);
	WScript.Echo("MigrateVirtualMachineTasksRecentTime: " + objItem.MigrateVirtualMachineTasksRecentTime);
	WScript.Echo("ModifyResourcesVirtualMachineTasksCompleted: " + objItem.ModifyResourcesVirtualMachineTasksCompleted);
	WScript.Echo("ModifyResourcesVirtualMachineTasksinProgress: " + objItem.ModifyResourcesVirtualMachineTasksinProgress);
	WScript.Echo("ModifyResourcesVirtualMachineTasksRecentTime: " + objItem.ModifyResourcesVirtualMachineTasksRecentTime);
	WScript.Echo("ModifyServiceSettingsTasksCompleted: " + objItem.ModifyServiceSettingsTasksCompleted);
	WScript.Echo("ModifyServiceSettingsTasksinProgress: " + objItem.ModifyServiceSettingsTasksinProgress);
	WScript.Echo("ModifyServiceSettingsTasksRecentTime: " + objItem.ModifyServiceSettingsTasksRecentTime);
	WScript.Echo("ModifyVirtualMachineTasksCompleted: " + objItem.ModifyVirtualMachineTasksCompleted);
	WScript.Echo("ModifyVirtualMachineTasksinProgress: " + objItem.ModifyVirtualMachineTasksinProgress);
	WScript.Echo("ModifyVirtualMachineTasksRecentTime: " + objItem.ModifyVirtualMachineTasksRecentTime);
	WScript.Echo("Name: " + objItem.Name);
	WScript.Echo("PauseVirtualMachineTasksCompleted: " + objItem.PauseVirtualMachineTasksCompleted);
	WScript.Echo("PauseVirtualMachineTasksinProgress: " + objItem.PauseVirtualMachineTasksinProgress);
	WScript.Echo("PauseVirtualMachineTasksRecentTime: " + objItem.PauseVirtualMachineTasksRecentTime);
	WScript.Echo("RemoveResourcesVirtualMachineTasksCompleted: " + objItem.RemoveResourcesVirtualMachineTasksCompleted);
	WScript.Echo("RemoveResourcesVirtualMachineTasksinProgress: " + objItem.RemoveResourcesVirtualMachineTasksinProgress);
	WScript.Echo("RemoveResourcesVirtualMachineTasksRecentTime: " + objItem.RemoveResourcesVirtualMachineTasksRecentTime);
	WScript.Echo("ResetVirtualMachineTasksCompleted: " + objItem.ResetVirtualMachineTasksCompleted);
	WScript.Echo("ResetVirtualMachineTasksinProgress: " + objItem.ResetVirtualMachineTasksinProgress);
	WScript.Echo("ResetVirtualMachineTasksRecentTime: " + objItem.ResetVirtualMachineTasksRecentTime);
	WScript.Echo("RestoreVirtualMachineTasksCompleted: " + objItem.RestoreVirtualMachineTasksCompleted);
	WScript.Echo("RestoreVirtualMachineTasksinProgress: " + objItem.RestoreVirtualMachineTasksinProgress);
	WScript.Echo("RestoreVirtualMachineTasksRecentTime: " + objItem.RestoreVirtualMachineTasksRecentTime);
	WScript.Echo("ResumeVirtualMachineTasksCompleted: " + objItem.ResumeVirtualMachineTasksCompleted);
	WScript.Echo("ResumeVirtualMachineTasksinProgress: " + objItem.ResumeVirtualMachineTasksinProgress);
	WScript.Echo("ResumeVirtualMachineTasksRecentTime: " + objItem.ResumeVirtualMachineTasksRecentTime);
	WScript.Echo("SaveVirtualMachineTasksCompleted: " + objItem.SaveVirtualMachineTasksCompleted);
	WScript.Echo("SaveVirtualMachineTasksinProgress: " + objItem.SaveVirtualMachineTasksinProgress);
	WScript.Echo("SaveVirtualMachineTasksRecentTime: " + objItem.SaveVirtualMachineTasksRecentTime);
	WScript.Echo("ShutdownVirtualMachineTasksCompleted: " + objItem.ShutdownVirtualMachineTasksCompleted);
	WScript.Echo("ShutdownVirtualMachineTasksinProgress: " + objItem.ShutdownVirtualMachineTasksinProgress);
	WScript.Echo("ShutdownVirtualMachineTasksRecentTime: " + objItem.ShutdownVirtualMachineTasksRecentTime);
	WScript.Echo("SnapshotVirtualMachineTasksCompleted: " + objItem.SnapshotVirtualMachineTasksCompleted);
	WScript.Echo("SnapshotVirtualMachineTasksinProgress: " + objItem.SnapshotVirtualMachineTasksinProgress);
	WScript.Echo("SnapshotVirtualMachineTasksRecentTime: " + objItem.SnapshotVirtualMachineTasksRecentTime);
	WScript.Echo("StartVirtualMachineTasksCompleted: " + objItem.StartVirtualMachineTasksCompleted);
	WScript.Echo("StartVirtualMachineTasksinProgress: " + objItem.StartVirtualMachineTasksinProgress);
	WScript.Echo("StartVirtualMachineTasksRecentTime: " + objItem.StartVirtualMachineTasksRecentTime);
	WScript.Echo("Timestamp_Object: " + objItem.Timestamp_Object);
	WScript.Echo("Timestamp_PerfTime: " + objItem.Timestamp_PerfTime);
	WScript.Echo("Timestamp_Sys100NS: " + objItem.Timestamp_Sys100NS);
	WScript.Echo("WaitingtoStartVirtualMachineTasksCompleted: " + objItem.WaitingtoStartVirtualMachineTasksCompleted);
	WScript.Echo("WaitingtoStartVirtualMachineTasksinProgress: " + objItem.WaitingtoStartVirtualMachineTasksinProgress);
	WScript.Echo("WaitingtoStartVirtualMachineTasksRecentTime: " + objItem.WaitingtoStartVirtualMachineTasksRecentTime);
	WScript.Echo("")
	WScript.Echo("########")
	WScript.Echo("")
}