tag:blogger.com,1999:blog-4414432572587218573.post6600764756861783365..comments2023-05-06T15:20:16.638+02:00Comments on Thoughts on Azure, OMS & SCOM: PowerShell: Auto Closing Alerts By Rules & Reckoning UTC Time With Day Light SavingsMarnix Wolfhttp://www.blogger.com/profile/09487479325587450184noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-4414432572587218573.post-668610957864418712015-05-19T04:18:29.270+02:002015-05-19T04:18:29.270+02:00Marnix, this is a welcome addition for SCOM PowerS...Marnix, this is a welcome addition for SCOM PowerShell Scripters! I know a few international SCOM deployments could really utilize this! As always awesome work sir!<br />Scott Moss<br />jscottmossATgmailDOTcomCitrixDudehttps://www.blogger.com/profile/12641019190946532454noreply@blogger.comtag:blogger.com,1999:blog-4414432572587218573.post-70485939669884217052015-05-08T09:16:02.144+02:002015-05-08T09:16:02.144+02:00Hi Marnix
Is there a specific reason why you didn&...Hi Marnix<br />Is there a specific reason why you didn't convert the alert's TimeRaised property directly using ToUniversalTime()? If so, please let me know as I do not normally bother taking the extra steps you described. I just do something like this:<br /><br />$AgeHours = 2<br />Get-SCOMAlert -Criteria "ResolutionState <> 255 AND IsMonitorAlert='False'" | `<br /> where {$_.TimeAdded.ToUniversalTime() -le (Get-Date).ToUniversalTime().addhours(-$AgeHours)}<br /><br />Cheers<br /><br />RaphaelAnonymousnoreply@blogger.com