<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Jason Rydstrand</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/jasonrydstrand/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/jasonrydstrand/feed.xml</link>
    <description>System Center and Powershell</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:26:37 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Daily SCOM Health Check with Powershell</title>
      <link>https://docs.microsoft.com/archive/blogs/jasonrydstrand/daily-scom-health-check-with-powershell</link>
      <pubDate>Wed, 27 Mar 2013 09:42:00 GMT</pubDate>
      <dc:creator><![CDATA[Jason Rydstrand]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jasonrydstrand/2013/03/27/daily-scom-health-check-with-powershell/</guid>
      <description><![CDATA[While working with an environment that was having issues with their Reporting Services, it was...]]></description>
      <content:encoded><![CDATA[<p>While working with an environment that was having issues with their Reporting Services, it was brought up that they had no insight into the Health Of SCOM. What it really turned into, was not having the data in email.</p>
<p>So, I have created the following script that can be ran on a Management Server.</p>
<p>First, example output</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/97/73/8400.Example-SCOM-HealthCheck_Page_1.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-97-73/8400.Example_2D00_SCOM_2D00_HealthCheck_5F00_Page_5F00_1.jpg"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/97/73/8400.Example-SCOM-HealthCheck_Page_1.jpg" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-97-73/8400.Example_2D00_SCOM_2D00_HealthCheck_5F00_Page_5F00_1.jpg" alt="" border="0" /></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/97/73/5824.Example-SCOM-HealthCheck_Page_2.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-97-73/5824.Example_2D00_SCOM_2D00_HealthCheck_5F00_Page_5F00_2.jpg"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/97/73/5824.Example-SCOM-HealthCheck_Page_2.jpg" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-97-73/5824.Example_2D00_SCOM_2D00_HealthCheck_5F00_Page_5F00_2.jpg" alt="" border="0" /></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/97/73/6266.Example-SCOM-HealthCheck_Page_3.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-97-73/6266.Example_2D00_SCOM_2D00_HealthCheck_5F00_Page_5F00_3.jpg"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/97/73/6266.Example-SCOM-HealthCheck_Page_3.jpg" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-97-73/6266.Example_2D00_SCOM_2D00_HealthCheck_5F00_Page_5F00_3.jpg" alt="" border="0" /></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/97/73/6403.Example-SCOM-HealthCheck_Page_4.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-97-73/6403.Example_2D00_SCOM_2D00_HealthCheck_5F00_Page_5F00_4.jpg"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/97/73/6403.Example-SCOM-HealthCheck_Page_4.jpg" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-97-73/6403.Example_2D00_SCOM_2D00_HealthCheck_5F00_Page_5F00_4.jpg" alt="" border="0" /></a></p>
<p>As you can see, it covers quite a bit of information.</p>
<p>&nbsp;</p>
<p>Here is a version of the script that you need to edit for your environment.</p>
<p>##############################################################################<br />#<br />#&nbsp;&nbsp; SCOMHealth-Check.ps1<br />#<br />#&nbsp;&nbsp; Script by: Jason Rydstrand<br />#<br />##############################################################################<br /><br />#Call SCOM powershell plugin and connect to Root Management Server<br />$rootMS = "RMS-SERVER"<br />Add-PSSnapin "Microsoft.EnterpriseManagement.OperationsManager.Client" -ErrorVariable errSnapin;<br />Set-Location "OperationsManagerMonitoring::" -ErrorVariable errSnapin;<br />new-managementGroupConnection -ConnectionString:$rootMS -ErrorVariable errSnapin;<br />New-PSDrive -Name: Monitoring -PSProvider: OperationsManagerMonitoring -Root: \ -ErrorAction SilentlyContinue -ErrorVariable Err<br />set-location $rootMS -ErrorVariable errSnapin;<br /><br /># Create header for HTML Report<br />$Head = "&lt;style&gt;"<br />$Head +="BODY{background-color:#CCCCCC;font-family:Verdana,sans-serif; font-size: x-small;}"<br />$Head +="TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse; width: 100%;}"<br />$Head +="TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:green;color:white;padding: 5px; font-weight: bold;text-align:left;}"<br />$Head +="TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:#F0F0F0; padding: 2px;}"<br />$Head +="&lt;/style&gt;"<br /><br /># Get status of Management Server Health and input them into report<br />write-host "Getting Management Health Server States" -ForegroundColor Yellow <br />$ReportOutput = "To enable HTML view, click on `"This message was converted to plain text.`" and select `"Display as HTML`""<br />$ReportOutput += "&lt;p&gt;&lt;H2&gt;Management Servers not in Healthy States&lt;/H2&gt;&lt;/p&gt;"<br /><br />$Count = Get-ManagementServer | where {$_.HealthState -ne "Success"} | Measure-Object<br /><br />if($Count.Count -gt 0) { <br />&nbsp;$ReportOutput += Get-ManagementServer | where {$_.HealthState -ne "Success"} | select Name,HealthState,IsRootManagementServer,IsGateway | ConvertTo-HTML -fragment<br />} else { <br />&nbsp;$ReportOutput += "&lt;p&gt;All management servers are in healthy state.&lt;/p&gt;"<br />} <br /><br /># Get status of Maintenance Mode for Root Management Server<br />write-host "Getting RMS Maintenance Mode" -ForegroundColor Yellow <br />$RMS = Get-ManagementServer | where {$_.IsRootManagementServer -eq $True} <br />$criteria = new-object Microsoft.EnterpriseManagement.Monitoring.MonitoringObjectGenericCriteria("InMaintenanceMode=1") <br />$objectsInMM = (Get-ManagementGroupConnection).ManagementGroup.GetPartialMonitoringObjects($criteria) <br />$is = "is not"<br />foreach ($MM in $objectsInMM){ <br />&nbsp;if($MM.Displayname -eq $RMS.Name){ <br />&nbsp;&nbsp; $is = "is"<br />&nbsp;} <br />} <br /><br />$ReportOutput += "&lt;h2&gt;RMS in Maintenance Mode&lt;/h2&gt;&lt;p&gt;"+ $RMS.Name +" "+$is+" in maintenance mode&lt;/p&gt;"<br /><br /># Get Agent Health Status and put none healthy ones into report<br />write-host "Getting Agent Health Status" -ForegroundColor Yellow <br />$criteria = new-object Microsoft.EnterpriseManagement.Monitoring.MonitoringObjectGenericCriteria("InMaintenanceMode=1")<br />$objectsInMM = (Get-ManagementGroupConnection).ManagementGroup.GetPartialMonitoringObjects($criteria)<br />$ObjectsFound = $objectsInMM | select-object DisplayName, @{name="Object Type";expression={foreach-object {$_.GetLeastDerivedNonAbstractMonitoringClass().DisplayName}}},@{name="StartTime";expression={foreach-object {$_.GetMaintenanceWindow().StartTime.ToLocalTime()}}},@{name="EndTime";expression={foreach-object {$_.GetMaintenanceWindow().ScheduledEndTime.ToLocalTime()}}},@{name="Path";expression={foreach-object {$_.Path}}},@{name="User";expression={foreach-object {$_.GetMaintenanceWindow().User}}},@{name="Reason";expression={foreach-object {$_.GetMaintenanceWindow().Reason}}},@{name="Comment";expression={foreach-object {$_.GetMaintenanceWindow().Comment}}}<br /><br />$ReportOutput += "&lt;h2&gt;Agents where Health State is not Green&lt;/h2&gt;"<br />#$ReportOutput += Get-Agent | where {$_.HealthState -ne "Success"} | Sort-Object HealthState -descending | select Name,HealthState | ConvertTo-HTML -fragment<br /><br />$Agents = Get-Agent | where {$_.HealthState -ne "Success"} | Sort-Object HealthState -descending | select Name,HealthState<br /><br />$AgentTable = New-Object System.Data.DataTable "$AvailableTable"<br />$AgentTable.Columns.Add((New-Object System.Data.DataColumn Name,([string])))<br />$AgentTable.Columns.Add((New-Object System.Data.DataColumn HealthState,([string])))<br />$AgentTable.Columns.Add((New-Object System.Data.DataColumn MM,([string])))<br />$AgentTable.Columns.Add((New-Object System.Data.DataColumn MMUser,([string])))<br />$AgentTable.Columns.Add((New-Object System.Data.DataColumn MMReason,([string])))<br />$AgentTable.Columns.Add((New-Object System.Data.DataColumn MMComment,([string])))<br />$AgentTable.Columns.Add((New-Object System.Data.DataColumn MMEndTime,([string])))<br /><br />foreach ($Agent in $Agents)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $FoundObject = $null<br />&nbsp;&nbsp;&nbsp; $MaintenanceModeUser = $null<br />&nbsp;&nbsp;&nbsp; $MaintenanceModeComment = $null<br />&nbsp;&nbsp;&nbsp; $MaintenanceModeReason = $null<br />&nbsp;&nbsp;&nbsp; $MaintenanceModeEndTime = $null<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $FoundObject = 0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $FoundObject = $objectsFound | ? {$_.DisplayName -match $Agent.Name -or $_.Path -match $Agent.Name}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($FoundObject -eq $null)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MaintenanceMode = "No"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MaintenanceObjectCount = 0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MaintenanceMode = "Yes"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MaintenanceObjectCount = $FoundObject.Count<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $MaintenanceModeUser = (($FoundObject | Select User)[0]).User<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $MaintenanceModeReason = (($FoundObject | Select Reason)[0]).Reason<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $MaintenanceModeComment = (($FoundObject | Select Comment)[0]).Comment<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $MaintenanceModeEndTime = ((($FoundObject | Select EndTime)[0]).EndTime).ToString()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewRow = $AgentTable.NewRow()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewRow.Name = ($Agent.Name).ToString()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewRow.HealthState = ($Agent.HealthState).ToString()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewRow.MM = $MaintenanceMode<br />&nbsp;&nbsp;&nbsp; $NewRow.MMUser = $MaintenanceModeUser<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewRow.MMReason = $MaintenanceModeReason<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewRow.MMComment = $MaintenanceModeComment<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewRow.MMEndTime = $MaintenanceModeEndTime<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $AgentTable.Rows.Add($NewRow)<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; <br />$ReportOutput += $AgentTable | Sort-Object MM | Select Name, HealthState, MM, MMUser, MMReason, MMComment, MMEndTime | ConvertTo-HTML -fragment<br /><br /># Also put into the report agents that have a state of "Not Monitored" and/or "Unavailable" - Grey Agents<br />$ReportOutput += "&lt;h2&gt;Agents where the Monitoring Class is not available&lt;/h2&gt;"<br />$AgentMonitoringClass = get-monitoringclass -name "Microsoft.SystemCenter.Agent"<br />$NotAvailable = Get-MonitoringObject -monitoringclass:$AgentMonitoringClass | where {$_.IsAvailable -eq $false} | select DisplayName<br />$AvailableTable = New-Object System.Data.DataTable "$AvailableTable"<br />$AvailableTable.Columns.Add((New-Object System.Data.DataColumn DisplayName,([string])))<br />$AvailableTable.Columns.Add((New-Object System.Data.DataColumn MM,([string])))<br />$AvailableTable.Columns.Add((New-Object System.Data.DataColumn MMUser,([string])))<br />$AvailableTable.Columns.Add((New-Object System.Data.DataColumn MMReason,([string])))<br />$AvailableTable.Columns.Add((New-Object System.Data.DataColumn MMComment,([string])))<br />$AvailableTable.Columns.Add((New-Object System.Data.DataColumn MMEndTime,([string])))<br />foreach ($NotAvailableAgent in $NotAvailable)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $FoundObject = $null<br />&nbsp;&nbsp;&nbsp; $MaintenanceModeUser = $null<br />&nbsp;&nbsp;&nbsp; $MaintenanceModeComment = $null<br />&nbsp;&nbsp;&nbsp; $MaintenanceModeReason = $null<br />&nbsp;&nbsp;&nbsp; $MaintenanceModeEndTime = $null<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $FoundObject = 0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $FoundObject = $objectsFound | ? {$_.DisplayName -match $NotAvailableAgent.DisplayName -or $_.Path -match $NotAvailableAgent.DisplayName}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($FoundObject -eq $null)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MaintenanceMode = "No"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MaintenanceObjectCount = 0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MaintenanceMode = "Yes"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MaintenanceObjectCount = $FoundObject.Count<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $MaintenanceModeUser = (($FoundObject | Select User)[0]).User<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $MaintenanceModeReason = (($FoundObject | Select Reason)[0]).Reason<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $MaintenanceModeComment = (($FoundObject | Select Comment)[0]).Comment<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $MaintenanceModeEndTime = ((($FoundObject | Select EndTime)[0]).EndTime).ToString()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewRow = $AvailableTable.NewRow()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewRow.DisplayName = ($NotAvailableAgent.DisplayName).ToString()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewRow.MM = $MaintenanceMode<br />&nbsp;&nbsp;&nbsp; $NewRow.MMUser = $MaintenanceModeUser<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewRow.MMReason = $MaintenanceModeReason<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewRow.MMComment = $MaintenanceModeComment<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewRow.MMEndTime = $MaintenanceModeEndTime<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $AvailableTable.Rows.Add($NewRow)<br />&nbsp;&nbsp;&nbsp; }<br />$ReportOutput += $AvailableTable | Sort-Object MM | Select DisplayName, MM, MMUser, MMReason, MMComment, MMEndTime | ConvertTo-HTML -fragment<br /><br /># Get Alerts specific to Management Servers and put them in the report<br />write-host "Getting Management Server Alerts" -ForegroundColor Yellow <br />$ReportOutput += "&lt;h2&gt;Management Server Alerts&lt;/h2&gt;"<br />$ManagementServers = Get-ManagementServer<br />foreach ($ManagementServer in $ManagementServers){ <br />&nbsp;$ReportOutput += "&lt;h3&gt;Alerts on " + $ManagementServer.ComputerName + "&lt;/h3&gt;"<br />&nbsp;$ReportOutput += get-alert -Criteria ("NetbiosComputerName = '" + $ManagementServer.ComputerName + "'") | where {$_.ResolutionState -ne '255' -and $_.MonitoringObjectFullName -Match 'Microsoft.SystemCenter'} | select TimeRaised,Name,Description,Severity | ConvertTo-HTML -fragment<br />}<br /><br />write-host "Getting all alerts"<br />$Alerts = Get-Alert -Criteria 'ResolutionState &lt; "255"'<br /><br /># Get alerts for last 24 hours<br />write-host "Getting alerts for last 24 hours"<br />$ReportOutput += "&lt;h2&gt;Top 10 Alerts With Same Name - 24 hours&lt;/h2&gt;"<br />$ReportOutput += $Alerts | where {$_.LastModified -le (Get-Date).addhours(-24)} | Group-Object Name | Sort-object Count -desc | select-Object -first 10 Count, Name | ConvertTo-HTML -fragment<br /><br />$ReportOutput += "&lt;h2&gt;Top 10 Repeating Alerts - 24 hours&lt;/h2&gt;"<br />$ReportOutput += $Alerts | where {$_.LastModified -le (Get-Date).addhours(-24)} | Sort-Object -desc RepeatCount | select-Object -first 10 RepeatCount, Name, MonitoringObjectPath, Description | ConvertTo-HTML -fragment<br /><br /># Get the Top 10 Unresolved alerts still in console and put them into report<br />write-host "Getting Top 10 Unresolved Alerts With Same Name - All Time" -ForegroundColor Yellow <br />$ReportOutput += "&lt;h2&gt;Top 10 Unresolved Alerts&lt;/h2&gt;"<br />$ReportOutput += $Alerts&nbsp; | Group-Object Name | Sort-object Count -desc | select-Object -first 10 Count, Name | ConvertTo-HTML -fragment<br /><br /># Get the Top 10 Repeating Alerts and put them into report<br />write-host "Getting Top 10 Repeating Alerts - All Time" -ForegroundColor Yellow <br />$ReportOutput += "&lt;h2&gt;Top 10 Repeating Alerts&lt;/h2&gt;"<br />$ReportOutput += $Alerts | Sort -desc RepeatCount | select-object &ndash;first 10 Name, RepeatCount, MonitoringObjectPath, Description | ConvertTo-HTML -fragment<br /><br /># Get list of agents still in Pending State and put them into report<br />write-host "Getting Agents in Pending State" -ForegroundColor Yellow <br />$ReportOutput += "&lt;h2&gt;Agents in Pending State&lt;/h2&gt;"<br />$ReportOutput += Get-AgentPendingAction | sort AgentPendingActionType | select AgentName,ManagementServerName,AgentPendingActionType | ConvertTo-HTML -fragment<br /><br /># Find Overrides that have been stored in the default management pack and put them into the report<br />write-host "Getting Overrides in Default Management Pack" -ForegroundColor Yellow <br />$ReportOutput += "&lt;h2&gt;Overrides in Default Management Pack&lt;/h2&gt;"<br />$OverrideCount = Get-ManagementPack | where {$_.DisplayName -match "Default Management Pack"} | get-override | measure-object<br />if($OverrideCount.Count -gt 2){ <br />&nbsp;foreach ($monitor in Get-ManagementPack | where {$_.DisplayName -match "Default Management Pack"} | get-override | where {$_.monitor}) { <br />&nbsp; $ReportOutput += get-monitor | where {$_.Id -eq $monitor.monitor.id} | select-object DisplayName,Description | ConvertTo-HTML -fragment<br />&nbsp; $ReportOutput += "&lt;br /&gt;"<br />&nbsp;} <br />&nbsp;foreach ($rule in Get-ManagementPack | where {$_.DisplayName -match "Default Management Pack"} | get-override | where {$_.rule}) { <br />&nbsp; $ReportOutput += get-rule | where {$_.Id -eq $rule.rule.id} | select-object DisplayName,Description | ConvertTo-HTML -fragment<br />&nbsp; $ReportOutput += "&lt;br /&gt;"<br />&nbsp;} <br />} else { <br />&nbsp;$ReportOutput += "&lt;p&gt;There are no unexpected overrides in the Default Management Pack&lt;/p&gt;"<br />}<br /><br /># List number of MM Objects that have been found.<br />$ReportOutput += "&lt;h2&gt;Count of objects in Maintanence Mode&lt;/h2&gt;"<br />$CountTable = New-Object System.Data.DataTable "$CountTable"<br />$CountTable.Columns.Add((New-Object System.Data.DataColumn ObjectCount,([int])))<br />$NewRow = $CountTable.NewRow()<br />$NewRow.ObjectCount = $ObjectsFound.Count<br />$CountTable.Rows.Add($NewRow)<br />$ReportOutput += $CountTable |Select @{n='ObjectCount';e={$_.ObjectCount}}, @{Name="Date";Expression={Get-Date -Format F}} | ConvertTo-Html -fragment<br /><br /># List Management Packs updated in last 24 hours<br />$ReportOutput += "&lt;h2&gt;Management Packs Updated&lt;/h2&gt;"<br />$MPDates = (Get-Date).adddays(-1)<br />$ReportOutput += Get-ManagementPack | Where {$_.LastModified -gt $MPDates} | Select-Object DisplayName, LastModified | Sort LastModified | ConvertTo-Html -fragment<br /><br /># Take all $ReportOutput and combine it with $Body to create completed HTML output<br />$Body = ConvertTo-HTML -head $Head -body "$ReportOutput"<br /><br />#$Body | Out-File C:\users\adm.j.rydstrand\desktop\HealthCheck-11-14-2012.html<br /><br /># Setup and send output as email message.<br />$smtpServer = "outgoing.server"<br />$msg = new-object Net.Mail.MailMessage<br />$smtp = new-object Net.Mail.SmtpClient($smtpServer)<br />$msg.From = "SCOM.REPORTS.DONOTREPLY@microsoft.com"<br />$msg.To.Add("jason.rydstrand@microsoft.com")<br />$msg.Subject = "SCOM Daily Healthcheck Report"<br />$msg.IsBodyHtml = 1<br />$msg.Body = $Body<br />$smtp.Send($msg)</p>
<p class="MsoNormal">&nbsp;</p>
<!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
  DefSemiHidden="true" DefQFormat="false" DefPriority="99"
  LatentStyleCount="267">
  <w:LsdException Locked="false" Priority="0" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
  <w:LsdException Locked="false" Priority="9" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 1"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 2"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 3"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 4"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 5"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 6"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 7"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 8"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 9"/>
  <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
  <w:LsdException Locked="false" Priority="10" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Title"/>
  <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
  <w:LsdException Locked="false" Priority="11" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
  <w:LsdException Locked="false" Priority="22" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
  <w:LsdException Locked="false" Priority="20" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
  <w:LsdException Locked="false" Priority="59" SemiHidden="false"
   UnhideWhenUsed="false" Name="Table Grid"/>
  <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
  <w:LsdException Locked="false" Priority="1" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 1"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
  <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
  <w:LsdException Locked="false" Priority="34" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
  <w:LsdException Locked="false" Priority="29" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
  <w:LsdException Locked="false" Priority="30" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 1"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 2"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 2"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 3"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 3"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 4"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 4"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 5"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 5"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 6"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 6"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
  <w:LsdException Locked="false" Priority="19" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
  <w:LsdException Locked="false" Priority="21" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
  <w:LsdException Locked="false" Priority="31" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
  <w:LsdException Locked="false" Priority="32" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
  <w:LsdException Locked="false" Priority="33" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
  <w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
  <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
 </w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>

<![endif]-->
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/9773/00/00/03/56/13/74/SANITIZED-SCOMHealth-Check.ps1" original-url="https://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-9773-00-00-03-56-13-74/SANITIZED_2D00_SCOMHealth_2D00_Check.ps1">SANITIZED-SCOMHealth-Check.ps1</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Gathering DAG Information - Part 1</title>
      <link>https://docs.microsoft.com/archive/blogs/jasonrydstrand/gathering-dag-information-part-1</link>
      <pubDate>Thu, 14 Mar 2013 09:38:09 GMT</pubDate>
      <dc:creator><![CDATA[Jason Rydstrand]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jasonrydstrand/2013/03/14/gathering-dag-information-part-1/</guid>
      <description><![CDATA[This is a part 1 of a series of scripts one can use to gather information about your Exchange 2010...]]></description>
      <content:encoded><![CDATA[<p>This is a part 1 of a series of scripts one can use to gather information about your Exchange 2010 DAGs.</p>
<p>First, credit where credit is due. Jay Newton is who wrote the initial script, and then I went over it and helped work out some of the kinks.</p>
<p>This script here is to help in finding the Whitespace for an individual DAG server.</p>
<p>#Generate whitespace report for an individual mailbox server<br /><br />#get local server name<br />$localserver = $env:computername<br /><br />#create array of all mailbox databases hosted on local server where name starts with DAG<br />$mailboxdbs = get-mailboxdatabase -server $localserver -status | select-object name,mountedonserver,databasesize,availablenewmailboxspace | where-object {$_.name -like "Dag*"}<br /><br />#Get information about the mount points for the DBs for each item in the array<br />foreach ($mailboxdb in $mailboxdbs)<br />&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$split = $($mailboxdb.name).split("-")<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$db = $split[1]<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$dbname = "*" + $db + "_data*"<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$mountinfo = Get-Wmiobject -query "select name,driveletter,capacity,freespace from win32_volume where drivetype=3" | where-object {$_.name -like $dbname }<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$mountname = $mountinfo.name<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$mountsizegb = ($mountinfo.capacity / 1gb)<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$mountfreegb = ($mountinfo.freespace / 1gb)<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$mountfreepct = ($mountfreegb*100/$mountsizegb)<br /><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;#add new array elements to represent the information returned from WMI query about the mount point<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$mailboxdb | add-member -membertype NoteProperty -Name "MountPoint" -value $mountname<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$mailboxdb | add-member -membertype NoteProperty -Name "SizeGB" -value $mountsizegb<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$mailboxdb | add-member -membertype NoteProperty -Name "FreeGB" -value $mountfreegb<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$mailboxdb | add-member -membertype NoteProperty -Name "Free%" -value $mountfreepct<br /><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;#echo results<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$mailboxdb<br /><br />&nbsp;&nbsp; &nbsp;}</p>
<p>Now, if you look closely, you will see the DB name has to start with Dag. So remember to change this to match your environment.</p>
<p>Here is an example output:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/97/73/2072.Exchange%20Mount%20Point%20Drive%20and%20Whitespace%20Info.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-97-73/2072.Exchange-Mount-Point-Drive-and-Whitespace-Info.jpg"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/97/73/2072.Exchange%20Mount%20Point%20Drive%20and%20Whitespace%20Info.jpg" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-97-73/2072.Exchange-Mount-Point-Drive-and-Whitespace-Info.jpg" alt="" border="0" /></a></p>
<p>In part 2, we will break down the script into it's components, add the Whitespace calculation, and then return it as a property bag for SCOM.</p>
<p>-Jason</p>]]></content:encoded>
    </item>
    <item>
      <title>Notification Groups - How to list members with powershell</title>
      <link>https://docs.microsoft.com/archive/blogs/jasonrydstrand/notification-groups-how-to-list-members-with-powershell</link>
      <pubDate>Thu, 24 Jan 2013 11:08:00 GMT</pubDate>
      <dc:creator><![CDATA[Jason Rydstrand]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jasonrydstrand/2013/01/24/notification-groups-how-to-list-members-with-powershell/</guid>
      <description><![CDATA[It was asked of me today: How can I get the groups and group members that are in a Notification...]]></description>
      <content:encoded><![CDATA[<p>It was asked of me today: How can I get the groups and group members that are in a Notification Group?</p>
<p>After a bit of pondering, this is what I came up with.</p>
<p>$Notifications = get-notificationsubscription | ? {$_.DisplayName -match "Sharepoint Notifications"}<br />$Groups = Get-MonitoringObjectGroup<br />foreach ($NotificationGroupID in ($Notifications.Configuration).MonitoringObjectGroupIds)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $WorkingGroup = $Groups | ? {$_.Id -match $NotificationGroupID}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $WorkingGroup | Select DisplayName<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Members = $WorkingGroup.GetRelatedMonitoringObjects()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Members | Sort DisplayName | Select DisplayName<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ""<br />&nbsp;&nbsp;&nbsp; }</p>
<p>Example Output:</p>
<p>DisplayName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br />-----------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br />All Sharepoint Computers &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />Server1.Example.com<br />Server2.Example.com<br />Server3.Example.com<br /><br />All Sharepoint Databases<br />DBServer1.Example.com<br />DBServer2.Example.com</p>]]></content:encoded>
    </item>
    <item>
      <title>First Technet Blog Post</title>
      <link>https://docs.microsoft.com/archive/blogs/jasonrydstrand/first-technet-blog-post</link>
      <pubDate>Thu, 24 Jan 2013 09:36:00 GMT</pubDate>
      <dc:creator><![CDATA[Jason Rydstrand]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jasonrydstrand/2013/01/24/first-technet-blog-post/</guid>
      <description><![CDATA[Many years ago, I started working with System Center Operations Manger in an Enterprise level...]]></description>
      <content:encoded><![CDATA[<p>Many years ago, I started working with System Center Operations Manger in an Enterprise level company. This company had some requirements that pushed SCOM to the limits, and actually helped shape some of the changes that have happened.</p>
<p>During that time, I ran a blog for what I was doing, but eventually let it fall to the side.</p>
<p>So the next few posts to this blog will probably be information that is outdated, as they will be copied from&nbsp; my old blog. Which is currently offline.</p>
<p>As things progress, some of the new challenges I will be dealing with and their solutions will show up here.</p>
<p>Jason</p>]]></content:encoded>
    </item>
  </channel>
</rss>