BRONZE PARTNER:
BRONZE PARTNER:
Industry News:

| |
| |
 |
 |
 |
 |
 |
| VBS Script To Create A MOM 2005 Daily Activity Summary Report To Excel |
 |
|
|
By: Don Hite
Posted On: 3/5/2007
This article was Previously posted on Don Hite's Blog
This Vbs Script will take a Microsoft Operation Manager (MOM) 2005 server name from an input box and return the daily activity summary for the MOM server and send the results to an Excel spreadsheet.
The spreadsheet will include the following information: Total Computer Groups, Total Computers Monitored, Total Critical Errors, Total Errors, Total Events Today, Total New Alerts Today, Total Security Breaches, Total Service Level Exceptions, Total Services Unavailable, Total Unresolved Alerts and Total Warnings.
VBS Script:
strComputer = InputBox ("Enter MOM Server Name")
Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True objExcel.Workbooks.Add intRow = 2 objExcel.Cells(1, 1).Value = "Computer Groups" objExcel.Cells(1, 2).Value = "Monitored" objExcel.Cells(1, 3).Value = "Critical Errors" objExcel.Cells(1, 4).Value = "Total Errors" objExcel.Cells(1, 5).Value = "Events Today" objExcel.Cells(1, 6).Value = "New Alerts Today" objExcel.Cells(1, 7).Value = "Security Breaches" objExcel.Cells(1, 8).Value = "Service Level Exceptions" objExcel.Cells(1, 9).Value = "Services Unavailable" objExcel.Cells(1, 10).Value = "Unresolved Alerts" objExcel.Cells(1, 11).Value = "Total Warnings"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\MOM") Set colItems = objWMIService.ExecQuery("Select * from MSFT_TodayStatistics") For Each objItem in colItems
objExcel.Cells(intRow, 1).Value = objItem.TotalComputerGroups objExcel.Cells(intRow, 2).Value = objItem.TotalComputersMonitored objExcel.Cells(intRow, 3).Value = objItem.TotalCriticalErrors objExcel.Cells(intRow, 4).Value = objItem.TotalErrors objExcel.Cells(intRow, 5).Value = objItem.TotalEventsToday objExcel.Cells(intRow, 6).Value = objItem.TotalNewAlertsToday objExcel.Cells(intRow, 7).Value = objItem.TotalSecurityBreaches objExcel.Cells(intRow, 8).Value = objItem.TotalServiceLevelExceptions objExcel.Cells(intRow, 9).Value = objItem.TotalServicesUnavailable objExcel.Cells(intRow, 10).Value = objItem.TotalUnresolvedAlerts objExcel.Cells(intRow, 11).Value = objItem.TotalWarnings intRow = intRow + 1 objExcel.Range("A1:K1").Select objExcel.Selection.Interior.ColorIndex = 19 objExcel.Selection.Font.ColorIndex = 11 objExcel.Selection.Font.Bold = True objExcel.Cells.EntireColumn.AutoFit Next
|
 |
 |
 |
|
|