Reset monitors all at once with a script

I am getting numerous SCOM Heath Monitor alerts for the following 2 conditions:
AD Domain Availability Health Degraded
AD Site Availability Health Degraded
I have searched the internet for scripts to reset them each all at once. I have found a couple of scripts and ran them in the SCOM Shell and they say that that are resetting the alerts but in actuality, they don't.
The scripts I used were found at these 2 sites:
(url)http://blogs.technet.com/b/ken_brumfield/archive/2010/06/23/making-the-world-greener-one-monitor-at-a-time-_2d00_-reset-scom-monitors-enmasse.aspx(/url)
(url)http://gallery.technet.microsoft.com/SCOM-2012-Batch-reset-63a17534(/url)
Does anyone know of a script that actually works for this purpose.

Use this simple PS, I am using this daily to reset health of closed alerts - please ensure you close the alerts as the script will only detect the closed alerts generated by the monitors
Works well for my purpose - hope this helps...
#PS to reset health of closed alerts generated by the monitors older than 7 days
# Import Operations Manager Module and create Connection 
Import-Module OperationsManager 
New-SCOMManagementGroupConnection 
$alerts=get-scomalert -Criteria "Severity!=0 AND IsMonitorAlert=1 AND ResolutionState=255"| where {$_.LastModified -ge ((get-date).AddDays(-7)).ToUniversalTime()} 
if ($alerts -is [object]) 
foreach ($alert in $alerts) 
$monitoringobject = Get-SCOMClassinstance -id $alert.MonitoringObjectId 
# Reset Monitor 
If (($monitoringobject.HealthState -eq "Error") -or ($monitoringobject.HealthState -eq "Warning")) 
$monitoringobject.ResetMonitoringState() 
Faizan

Similar Messages

  • Monitor all service Start with the word "SAP"

    Hallo
    i have sccm 2012 
    Can monitor services start with the word "SAP"
    Instead of monitoring all service set separately .
    thanks 

    Hi,
    Did some research and came to the following solution
    Open the System Center Operations Manager Console. 
    Go to Authoring and expand Management Pack Templates
    Right Click Windows Service and click Add Monitoring Wizard
    On the Monitoring Type page select Windows Service and click Next
    Give the Service and store the it in a New Created Management Pack and click Next
    On the Service Name Type SAP* on the Target group Select Windows Server Computer Group and click Next
    On the Performance Data page click Next
    On the Summary page click Create
    Export the Management Pack pack you created
    In the Management pack replace the following code:
    <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.Win32ServiceInformationProviderWithClassSnapshotDataMapper">
    <ComputerName>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
    <ServiceName>sap*</ServiceName>
    <Frequency>60</Frequency>
    With the following code
    <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.WmiProviderWithClassSnapshotDataMapper">
    <NameSpace>root\cimv2</NameSpace>
    <Query>select * from win32_service where name like 'sap%'</Query>
    <Frequency>60</Frequency>
    Second replace
    <Value>$Data/Property[@Name='BinaryPathName']$</Value>
    With
    <Value>$Data/Property[@Name='PathName']$</Value>
    Save the management pack and upload it to System Center Operations Manager.
    In the Operations Console Click Monitoring
    Click Discoverd Inventory and change the target type to the target you created. Then the view should look something like this:
    I created the management pack You can download it from here: http://www.ms-opsmgr.eu/wp-content/uploads/Download/2015/SAP/SAP.Services.xml
    GReetings Roel Knippen
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • JSP Shell Script Output (All At Once Vs Line By Line)

    I have no problem calling a shell script and then displaying that output on a web page.
    However, I would like to display the output as the script executes (I want to print the output line by line as it happens), rather than waiting for the script to completely finish and then display the whole output all at once. The script checks a large database and takes about 10 minutes to run. I don't want to stare at a blank screen during that time, but of course want to watch it's progress on the display (when I run the script directly I print out status to the screen).
    Can someone point me in the right direction on how to do this?
    -jsaspo

    Bump...
    Anyone?

  • How can I compile all functions, procedures and packages with a script?

    I need to compile all functions, procedures and packages of 5 schemas (users) with a script.
    How can I do it?
    Thanks!

    you can create a script to select all invalid objects in those schemas Since Oracle 8 introduced NDS this approach has struck me as a trifle old fashioned. It's much simpler to loop round the query in PL/SQL and use EXECUTE IMMEDIATE to fire off the DDL statements. No scripts, no muss, no fuss.
    Having said that, the problem with this approach and also with using DBMS_UTILITY.COMPILE_SCHEMA is that they do not compile all the invalid objects in dependency order. This may result in programs being invalidated by the subsequent compilation of dependencies. This is due to the introduction of Java into the database.
    The UTLRP script is much better, because it (usually) avoids cyclic references. But you still may need to run it more than once.
    In general it is better to avoid sledgehammer recompilations (like DBMS_UTILITY.COMPILE_SCHEMA, which starts by invalidating all the objects). If we have twenty invalid objects, nineteen of which are dependencies of the twentieth, we actually only need to recompile the master object, as recompiling it will trigger the recompilation of all the others.
    Cheers, APC

  • Script to change numbers all at once...

    Hi,
    I work with technical drawings...90% of my time is changing the numbers on the drawing.   I take the PDF that was created in UG/NX and then open that in Illustrator to make formatting changes, and number changes. 
    What I would love, is to have a script that will let me take an excel file, text file (something)  the file would list the current numbers and list the new numbers, and have the illustrator script switch all the numbers at once.
    I know there is the find and replace but that takes too long, and I have to worry about if I'm changing 2 to 5, that it's not going to change 20 to 50. Even with the script that would be a concern.
    Is what I want even doable with a script,  and do you have any suggestions on how to get started?  I have someone who can help me with the code, just want to see if it's even possible.
    Sample list would look something like,
    Old number, New Number
    1, 5
    2, 6
    3, 7
    4, 8
    5, 9
    6, 10
    7, 11
    8, 12
    9, 13
    10,
    11, 14
    12, 15
    13, 16
    15,
    16, 17
    Numbers can go into the 400's
    TIA
    Karleen

    thanks for answering me.
    One number is never replaced by two different numbers. 
    How would I get started working on the code?  VB, Java?   Any tips or suggestions would be great.  
    Thanks!

  • Permissions Error if Script is run more than once with out closing Diadem

    I am in a REAL pickle here and need some HELP......
    I get a permissions error message when I try and run my scripts more than once with out closing Diadem 2011.
    Call scriptinclude ("D:\_Calterm_Configuration_Files\Technical_Information\DIAdem_Scripts\Importing Multiple Data Logs_CaltermIII_Local.VBS")
    Error is around this portion of script:
    '******* GetFilePaths() *** *** NEW Function ***
    Function GetFilePaths(DefaultDir, ExtFilter, MultipleDir, Msg)
    Dim i, k, f, fso, iMax, FileListPath, StartIdx, CurrFiles, FileList
    ' Promt the User to select the ASCII files to load with a File Dialog
    FileListPath = AutoActPath & "FileDlgList.asc"
    Set fso = CreateObject("Scripting.FileSystemObject")
    StartIdx = 0
    ReDim FileList(0)
    Do ' Until (DlgState = "IDCancel")
    Call FileNameGet("ANY", "FileRead", DefaultDir, ExtFilter, FileListPath, 1, Msg)
    IF (DlgState = "IDCancel") THEN Exit Do
    ' Read in the saved list of file(s) selected in the File Dialog into FileList()
    **** This next line is where the ERROR happens *******
    Set f = fso.OpenTextFile(FileListPath, 1, True) ' f.ReadAll returns file contents
    CurrFiles = Split(vbCRLF & f.ReadAll, vbCRLF) ' turn file lines into an array
    f.Close ' close the file
    iMax = UBound(CurrFiles)
    IF iMax > 0 AND Trim(CurrFiles(iMax)) = "" THEN
    iMax = iMax - 1
    ReDim Preserve CurrFiles(iMax)
    END IF
    Call BubbleSort(CurrFiles) ' sort the array of file names alphabetically
    ' Append current file dialog selection(s) to any previous file dialog selection(s)
    IF iMax < 1 THEN iMax = 0
    ReDim Preserve FileList(k + iMax)
    FOR i = 1 TO iMax
    k = k + 1
    FileList(k) = CurrFiles(i)
    NEXT ' i
    IF MultipleDir <> TRUE THEN Exit Do ' forces only 1 dialog, good if all desired files are in the same folder
    Loop ' Until (DlgState = "IDCancel")
    GetFilePaths = FileList
    End Function ' GetFilePaths()
    266 6:18:34 PM Error:
    Error in <NoName(1).VBS> (Line: 8, Column: 1):
    Error in <Importing Multiple Data Logs_CaltermIII_Local.VBS> (Line: 140, Column: 5):
    Permission denied
    I can send the script and file I am loading if that would help.
    Solved!
    Go to Solution.

    Jcheese,
    I understood that if you call this script within DIAdem you don't get any error, however, when you run that script from another source (with DIAdem opened) for the second time you get the error, right? 
    If this is the case, I think it might be that the file haven't close correctly in the script. Could you upload the script file?
    Carmen C.

  • My 1st generation Ipod touch won't turn on at all and whenever I press the buttons to reset it all I get is a white screen, or a white screen with black lines across.

    My 1st generation Ipod touch won't turn on at all and whenever I press the buttons to reset it all I get is a white screen, or a white screen with black lines across.Help pleaseeeeee!

    You can work through the five 5 R's of troubleshooting to rule out the possibility of corrupted software.
    http://www.apple.com/support/ipod/five_rs/
    It might also be a good idea to let the iPod's battery fully drain. Then charge it back up and restore it once more in iTunes.
    Otherwise, it's likely a hardware issue with the iPod's LCD display, meaning you'll need to take or send your iPod in for service either via Apple or a third party repair service. Here is Apple's repair pricing.
    http://www.apple.com/support/ipod/service/prices/
    Note that they don't actually repair the device, but exchange it for one of the same generation, model, and capacity.  A third party service will actually replace the damaged part for a little less.  Google "iPod screen repair" and you should get a number of results to work with.
    B-rock

  • TS1381 My left arrow does not work on my macbook pro(model A1226).  I have reset nvram, performed a safe boot, pulled the cache to desktop, replaced .globalpreference.plist, test all other keys with keyboard view (all others work)  - HELP!!

    My left arrow does not work on my macbook pro(model A1226).
    I have reset nvram, performed a safe boot, pulled the cache to desktop, replaced .globalpreference.plist, & tested all other keys with "keyboard viewer" (all other keys work except for the arrow). 
    In addition, I have gone thru all the recommended checks with universal access and have booted from snow leopard dvd and the left arrow still does not work. 
    I have tried using the left arrow key in all of applications I use such as: excel, ms word, address book, calendar, iphoto, terminal, & highlighting an icon and using the arrows to move to another selected icon.
    Here is the kicker!  In addition, I purchased a logitech solar bluetooth keyboard and the arrows work fine with my ipad but do not work when paired with the macbook pro. All other keys work fine on the macbook pro using the bluetooth keyboard.
    I believe this says that the problem is not in my macbook pro keyboard. So where can it be?
    Can anyone think of any other rabbit holes I can search?
    thanks and regards
    vats3

    I would also like to add that I've reverted the two cd drive and hard drive mods I did and the laptop is back to factory hardware and there is 0 corrosion or mold visible.

  • HT1373 I bought an ipod nano 5th gen and it came with 900 songs on it. How can i retain the music before i authorize this unit to my itunes account? It says it will erase all content once I sync with my imac7. Is there anyway to keep the music??? please h

    I bought a used ipod nano 5th gen and it came with 900 songs on it. How can i transfer, sync, and retain the music before i authorize this unit to my itunes account? It says it will erase all content once I sync with my imac7. Is there anyway to keep the music??? please help!!
    Thanks,
    Aaron

    The music does not belong to you.  You have no legal right to it and there is no way to keep it.
    Sorry

  • Help with Powershell script to gather eventlogs from all Domain Controllers

    I am trying to write a script to grab the last 5 days of application, security and system logs from all domain controllers. The script runs but only pulls the logs from the local server. The $Computer variable has all of my DC's so it is querying fine. I
    assume it is an issue with my ForEach-Object line but it doesn't error out. See the script below.
    $log = "Application"
    $date = get-date -format MM-dd-yyyy
    $now = get-date
    $subtractDays = New-Object System.TimeSpan 5,0,0,0,0
    $then = $Now.Subtract($subtractDays)
    $Computers = Get-ADDomainController -filter *
    ForEach-Object -InputObject $Computers  -Process {Get-EventLog -LogName $log -After $then -Before $now -EntryType Error | select EventID,MachineName,Message,Source,TimeGenerated | ConvertTo-html | Out-File $env:TEMP\Applicationlog.htm}
    Invoke-Expression $env:TEMP\Applicationlog.htm
    Thanks,
    Rich

    Also, you're missing the -ComputerName parameter in the Get-EventLog Cmdlet. 
    I would re-write the loop part of the script like this:
    $log = "Application"
    $date = get-date -format MM-dd-yyyy
    $now = get-date
    $subtractDays = New-Object System.TimeSpan 5,0,0,0,0
    $then = $Now.Subtract($subtractDays)
    $Computers = Get-ADDomainController -filter *
    foreach ($Computer in $computers) {
    Get-EventLog -ComputerName $Computer -LogName $log -After $then -Before $now -EntryType Error |
    select EventID,MachineName,Message,Source,TimeGenerated | ConvertTo-html | Out-File .\Applicationlog.htm -append
    Invoke-Expression .\Applicationlog.htm
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable)

  • Having problems with ipad mini and Siri. Works sporadically, will work once and then the second time not. Worked all the time with the original Mailbox app. Then started doing the same thing when I installed the new update so wondering if it is software?

    Having problems with ipad mini and Siri. Works sporadically, will work once and then the second time not. Worked all the time with the original Mailbox app. Then started doing the same thing when I installed the new update so wondering if it is software?

    Hi,
    I have the check box on a second Partition  but not on the Time Machine one
    I forget what I did now to get this called "Recovery HD"
    For the rest try https://discussions.apple.com/docs/DOC-4055  User Tip that links to Pondini's work on Time Machine.
    10:17 pm      Friday; May 2, 2014
    ​  iMac 2.5Ghz i5 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • I need to connect my Imac 27'' (newest version) up to 3/4 monitors (all 40'' LCD tv's with VGA and HDMI connections) with extended display to all external screens, not duplicate images. Is this possible?

    i need to connect my Imac 27'' (newest version) up to 3/4 monitors (all 40'' LCD tv's with VGA and HDMI connections) with extended display to all external screens, not duplicate images. Is this possible?

    I would suggest you visit an Apple dealer, preferably an Apple Store if there's one in your city, and ask for assistance in determining what you need. The questions and issues you bring up are rather complex to address in a technical support forum and would be better addressed in person where you and the salesperson can ask questions back and forth to arrive at the optimal setup.
    Regards.

  • ' delete an app. All apps wiggle incl. the one in questions. However the app I want to delete does not show the x button. I reseted, also restrictions are on with on for apps delete. Suggestions?

    ' delete an app. All apps wiggle incl. the one in questions. However the app I want to delete does not show the x button. I reseted, also restrictions are on with on for apps delete. Suggestions?

    mardemar wrote:
    ... - the only one without an x delete button.
    What is the name of this App and where did you get it...?

  • HT201274 i have ipod 2nd generation and i had reset   Erase All Content and Settings it is longer than 3 hrs it is still showing apple logo and blink like if it will restart but again it shows the same logo!! is it all right with the erasing...??? i am co

    i have ipod 2nd generation 32 gb and i had reset >  Erase All Content and Settings it is longer than 3 hrs it is still showing apple logo and blink like if it will restart but again it shows the same logo!! is it all right with the erasing...??? i am confused!!

    For a 1G and 2G it can take hours. Make sure it is connected to a charging source otherwise the battery can fully drain before it is done. If still problem
    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer          
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • ¿Print multiple images with specific settings all at once?

    Hi,
    I have never been able to fully get the Automator to work...
    Here's my scenario.
    I use Fedex Online to make labels and use their adhesive labels, but I usually need to print about 17 at a time... So instead of printing 1 by 1... I save the PNG files... Then I setup a template in pages, with 17 pages and replace each image 1 by 1, then print....
    Which is a lot of work, then I have to double check to make sure I didn't duplicate 1 form, etc...
    SO what can I do to A. Get them to print all at once and B. Make sure they are setup to print to the FEDEX labels margins (Right/Left: .5", top .375", bottom 5.5")?
    I already made a custom page setting in page setup...
    hopefully someone can offer some insight
    Thanks

    Another thing I tried was to save images into a pdf, but I don't know where the PDF is saved to...
    What is the order that I am supposed to do things in?
    What I have now is:
    1. Get specified Finder items (I have the items selected)
    2. Compress Images into PDF Document
    Now what? When I press play, it seems to work, but I don't know where the PDF is saved...

Maybe you are looking for

  • Adobe Bridge Slideshow Format with Adobe Muse

    When I am using Adobe Bridge and I go to Review Mode, a slideshow comes up that is full screen and the pictures rotate as you swipe them. Is there a way to use this slideshow format in Adobe Muse?

  • Problem with J components...

    Question: Why do JComboBox or JTextField ( and I pressume others ) do not work if I put them in a JWindow. They work only in a JFrame. In jdk1.5.0 JComboBox was working properly in a JWindow as well. In the 1.6.0 it does not! Do you know what might b

  • Web pages won't adjust automatically to the width of my browser.

    MS IE will automatically adjust the web page to the size of the browser. But Firefox doesn't do this, so I have to scroll left and right. Can this be fixed? == This happened == Every time Firefox opened

  • Windows can't open Illustrator.

    Why does Windows can't open Illustrator? thank you for your help.

  • How to get HTTP headers from Data Provider Class?

    Hi, I'm the beginner in SAP NetWeaver Gateway. Using Service Builder I created CRUD OData web service and implemented CRUD operations in Data Provider Class. Data Provider Class has methods like MYENTITY_GET_ENTITYSET, MYENTITY_GET_ENTITY, MYENTITY_C