-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2188 from microsoft/dpaul-HcMonitoringOverride
Add Monitoring Override Check and Analysis
- Loading branch information
Showing
12 changed files
with
230 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
Diagnostics/HealthChecker/Tests/DataCollection/E19/Exchange/GetGlobalMonitoringOverride.xml
Large diffs are not rendered by default.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
Diagnostics/HealthChecker/Tests/DataCollection/E19/Exchange/GetServerMonitoringOverride.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"> | ||
<Obj RefId="0"> | ||
<TN RefId="0"> | ||
<T>Deserialized.Microsoft.Exchange.Monitoring.ActiveMonitoring.MonitoringOverrideObject</T> | ||
<T>Deserialized.Microsoft.Exchange.Data.ConfigurableObject</T> | ||
<T>Deserialized.System.Object</T> | ||
</TN> | ||
<ToString>Microsoft.Exchange.Monitoring.ActiveMonitoring.MonitoringOverrideObject</ToString> | ||
<Props> | ||
<S N="ItemType">Responder</S> | ||
<S N="PropertyName">Enabled</S> | ||
<S N="PropertyValue">0</S> | ||
<S N="HealthSetName">AD</S> | ||
<S N="MonitoringItemName">ActiveDirectoryConnectivityConfigDCServerReboot</S> | ||
<S N="TargetResource"></S> | ||
<S N="ExpirationTime">2024-09-29 17:40:49Z</S> | ||
<S N="ApplyVersion"></S> | ||
<S N="CreatedBy">Solo.com/Users/Han</S> | ||
<S N="CreatedTime">2024-09-09 17:40:49Z</S> | ||
<S N="Identity">AD\ActiveDirectoryConnectivityConfigDCServerReboot</S> | ||
<B N="IsValid">true</B> | ||
<S N="ObjectState">New</S> | ||
</Props> | ||
<MS> | ||
<BA N="SerializationData">AAEAAAD/////AQAAAAAAAAAMAgAAAGFNaWNyb3NvZnQuRXhjaGFuZ2UuTWFuYWdlbWVudCwgVmVyc2lvbj0xNS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj0zMWJmMzg1NmFkMzY0ZTM1DAMAAABbTWljcm9zb2Z0LkV4Y2hhbmdlLkRhdGEsIFZlcnNpb249MTUuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49MzFiZjM4NTZhZDM2NGUzNQUBAAAAR01pY3Jvc29mdC5FeGNoYW5nZS5Nb25pdG9yaW5nLkFjdGl2ZU1vbml0b3JpbmcuTW9uaXRvcmluZ092ZXJyaWRlT2JqZWN0BAAAAAtwcm9wZXJ0eUJhZx5Db25maWd1cmFibGVPYmplY3QrcHJvcGVydHlCYWcsQ29uZmlndXJhYmxlT2JqZWN0K3NlcmlhbGl6ZXJBc3NlbWJseVZlcnNpb24mQ29uZmlndXJhYmxlT2JqZWN0K2luc3RhbnRpYXRpb25FcnJvcnMEBAMDMU1pY3Jvc29mdC5FeGNoYW5nZS5EYXRhLlNpbXBsZVByb3ZpZGVyUHJvcGVydHlCYWcDAAAAMU1pY3Jvc29mdC5FeGNoYW5nZS5EYXRhLlNpbXBsZVByb3ZpZGVyUHJvcGVydHlCYWcDAAAADlN5c3RlbS5WZXJzaW9uqQFTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW01pY3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2UuRGF0YS5TaW1wbGVQcm92aWRlclByb3BlcnR5RGVmaW5pdGlvbgMAAAADAAAACQkAAAAJCgAAAAH1////+P///wkMAAAACQ0AAAAB8v////j///8JDwAAAAkQAAAAAe/////4////CRIAAAAGEwAAAAlSZXNwb25kZXIB7P////j///8JFQAAAAYWAAAAB0VuYWJsZWQB6f////j///8JGAAAAAYZAAAAATAB5v////j///8JGwAAAAYcAAAAAkFEAeP////4////CR4AAAAGHwAAAC9BY3RpdmVEaXJlY3RvcnlDb25uZWN0aXZpdHlDb25maWdEQ1NlcnZlclJlYm9vdAHg////+P///wkhAAAABiIAAAAUMjAyNC0wOS0yOSAxNzo0MDo0OVoB3f////j///8JJAAAAAYlAAAAElNvbG8uY29tL1VzZXJzL0hhbgHa////+P///wknAAAABigAAAAUMjAyNC0wOS0wOSAxNzo0MDo0OVoHBwAAAAABAAAACwAAAAQtTWljcm9zb2Z0LkV4Y2hhbmdlLkRhdGEuUHJvcGVydHlCYWcrVmFsdWVQYWlyAwAAAAHX////+P///wkPAAAACgHV////+P///wkSAAAACgHT////+P///wkVAAAACgHR////+P///wkYAAAACgHP////+P///wkbAAAACgHN////+P///wkeAAAACgHL////+P///wk2AAAACgHJ////+P///wkhAAAACgHH////+P///wk6AAAACgHF////+P///wkkAAAACgHD////+P///wknAAAACgUJAAAAOE1pY3Jvc29mdC5FeGNoYW5nZS5EYXRhLlNpbXBsZVByb3ZpZGVyUHJvcGVydHlEZWZpbml0aW9uBQAAAAVmbGFncxdQcm9wZXJ0eURlZmluaXRpb24rbmFtZRdQcm9wZXJ0eURlZmluaXRpb24rdHlwZRtQcm9wZXJ0eURlZmluaXRpb24rdHlwZU5hbWU5UHJvcGVydHlEZWZpbml0aW9uK3JlcXVpcmVkUHJvcGVydHlEZWZpbml0aW9uc1doZW5SZWFkaW5nAAEDAQMIH1N5c3RlbS5Vbml0eVNlcmlhbGl6YXRpb25Ib2xkZXKzAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmlj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lvbglLAAAABmcAAABaU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5CgRAAAAAH1N5c3RlbS5Vbml0eVNlcmlhbGl6YXRpb25Ib2xkZXIDAAAABERhdGEJVW5pdHlUeXBlDEFzc2VtYmx5TmFtZQEAAQgGaAAAACNNaWNyb3NvZnQuRXhjaGFuZ2UuRGF0YS5PYmplY3RTdGF0ZQQAAAAGaQAAAFtNaWNyb3NvZnQuRXhjaGFuZ2UuRGF0YSwgVmVyc2lvbj0xNS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj0zMWJmMzg1NmFkMzY0ZTM1AUMAAABAAAAABmoAAAAtTWljcm9zb2Z0LkV4Y2hhbmdlLkRhdGEuRXhjaGFuZ2VPYmplY3RWZXJzaW9uBAAAAAlpAAAAAUcAAABAAAAABmwAAAAgTWljcm9zb2Z0LkV4Y2hhbmdlLkRhdGEuT2JqZWN0SWQEAAAACWkAAAABSwAAAEAAAAAGbgAAAA1TeXN0ZW0uU3RyaW5nBAAAAAZvAAAAS21zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQs=</BA> | ||
<S N="PSComputerName">solo-e19a.solo.com</S> | ||
<G N="RunspaceId">6f717724-bc29-4a09-a19f-5512f339b875</G> | ||
<B N="PSShowComputerName">false</B> | ||
</MS> | ||
</Obj> | ||
</Objs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
function Get-MonitoringOverride { | ||
[CmdletBinding()] | ||
[OutputType([System.Collections.Generic.List[object]])] | ||
param( | ||
# If Server is provided, then we are doing Get-ServerMonitoringOverride. Otherwise, we are doing Get-GlobalMonitoringOverride. | ||
[Parameter(Mandatory = $false)] | ||
[string]$Server, | ||
|
||
[Parameter(Mandatory = $false)] | ||
[ScriptBlock]$CatchActionFunction | ||
) | ||
process { | ||
try { | ||
$monitoringOverrides = New-Object System.Collections.Generic.List[object] | ||
$monitoringOverridesSimple = New-Object System.Collections.Generic.List[object] | ||
$globalMonitoringOverride = [string]::IsNullOrEmpty($Server) | ||
if ($globalMonitoringOverride) { | ||
$monitoringOverride = Get-GlobalMonitoringOverride -ErrorAction Stop | ||
} else { | ||
$monitoringOverride = Get-ServerMonitoringOverride -Server $Server -ErrorAction Stop | ||
} | ||
|
||
foreach ($override in $monitoringOverride) { | ||
$monitoringOverrides.Add([PSCustomObject]@{ | ||
ItemType = $override.ItemType | ||
PropertyName = $override.PropertyName | ||
PropertyValue = $override.PropertyValue | ||
HealthSetName = $override.MonitoringItemName | ||
TargetResource = $override.TargetResource | ||
ExpirationTime = $override.ExpirationTime | ||
ApplyVersion = $override.ApplyVersion | ||
CreatedBy = $override.CreatedBy | ||
CreatedTime = $override.CreatedTime | ||
Identity = $override.Identity | ||
IsValid = $override.IsValid | ||
}) | ||
$monitoringOverridesSimple.Add([PSCustomObject]@{ | ||
Identity = $override.Identity | ||
ItemType = $override.ItemType | ||
PropertyName = $override.PropertyName | ||
PropertyValue = $override.PropertyValue | ||
ApplyVersion = $override.ApplyVersion | ||
IsValid = $override.IsValid | ||
IsGlobal = $globalMonitoringOverride | ||
ExpirationTime = $override.ExpirationTime | ||
}) | ||
} | ||
return [PSCustomObject]@{ | ||
MonitoringOverrides = $monitoringOverrides | ||
SimpleView = $monitoringOverridesSimple | ||
} | ||
} catch { | ||
|
||
Write-Verbose "Failed to get the monitoring override. Inner Exception $_" | ||
|
||
if ($null -ne $CatchActionFunction) { | ||
& $CatchActionFunction | ||
} | ||
} | ||
} | ||
} |