That's correct. The only other thing you can pass with a MonitoringAlert.Update is the MonitoringConnector object.
Is there a specific reason you need it to be all in one, or is it more of an aesthetic choice? And to add to what Henrik said, if you call $alert.Update() without passing anything to it, any workflows attached to that (I.E. notifications) will re-fire (Unless they fixed this recently, I've been trying to see if we have it that way on purpose or if its a bug that it behaves that way and has since 2007) On Thu, Aug 20, 2015 at 5:47 PM, Orlebeck, Geoffrey < [email protected]> wrote: > Pardon my ignorance, but if ‘$alert.update’ is the only option, I can’t > call that method along with the resolution state to achieve my goal, can I? > With that being the only way to update the history, I would have to just > settle for two entries in the Alert history, right? > > > > Thanks, > > Geoff > > > > *From:* [email protected] [mailto: > [email protected]] *On Behalf Of *Henrik Andersen > *Sent:* Thursday, August 20, 2015 2:21 PM > *To:* [email protected] > *Subject:* [msmom] SV: Upate Resolution State with Comment History > > > > > > Hi!, > > > > I ‘ll advise you to do a bit more testing. The only statement that > updates the history, is the $alert.update(“text”) . Infact, if you omit the > text (like $alert.update(“”) ) you won’t get any history entry at all. > > > > /Henrik > > > > > > > > > > *Fra:* [email protected] [ > mailto:[email protected] <[email protected]>] *På > vegne af *Orlebeck, Geoffrey > *Sendt:* 20. august 2015 19:52 > *Til:* '[email protected]' > *Emne:* [msmom] Upate Resolution State with Comment History > > > > Is there a way to update the resolution state of an alert and add a > comment without creating two separate entries in the Alert History? > > > > I setup a test alert and want to modify the Resolution State ID to a > custom ID of ‘2’. Using this (there is only one alert), I semi-achieve what > I want: > > > > $Alert = Get-SCOMAlert -ResolutionState 0 –Severity 2 –Name “Geoff_Test*” > > $Alert.ResolutionState = 2 > > $Alert.Update(“Testing comment function”) > > > > > > If there are multiple alerts, I can pass them through a foreach loop: > > > > $Alerts = Get-SCOMAlert -ResolutionState 0 –Severity 2 –Name “Geoff_Test*” > > foreach ($Alert in $Alerts) > > { > > $Alert.ResolutionState = 2 > > $Alert.Update(“Testing comment function”) > > } > > > > I understand my code is two steps, so it creates two entries in the alert > history: a generic “Alert modified by user” when the Resolution State > changes and a second entry with the ‘Testing comment function’ text. My > goal is to have the resolution state change with the comment I’m defining. > I’ve tried a few different ways of wrapping the commands without luck. Is > anyone currently doing this? > > > > Thanks. > > -Geoff > > > > > > > > Confidentiality Notice: This is a transmission from Community Hospital of > the Monterey Peninsula. This message and any attached documents may be > confidential and contain information protected by state and federal medical > privacy statutes. They are intended only for the use of the addressee. If > you are not the intended recipient, any disclosure, copying, or > distribution of this information is strictly prohibited. If you received > this transmission in error, please accept our apologies and notify the > sender. Thank you. > > > > > Confidentiality Notice: This is a transmission from Community Hospital of > the Monterey Peninsula. This message and any attached documents may be > confidential and contain information protected by state and federal medical > privacy statutes. They are intended only for the use of the addressee. If > you are not the intended recipient, any disclosure, copying, or > distribution of this information is strictly prohibited. If you received > this transmission in error, please accept our apologies and notify the > sender. Thank you. > >
