Exchange Server EnablePushNotifications is enabled
http://go.microsoft.com/fwlink/?LinkId=251674
Target | Microsoft.KnowledgeServices.Exchange.2010.ClientAccessRole | ||
Parent Monitor | System.Health.ConfigurationState | ||
Category | Alert | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | Information | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.KnowledgeServices.Library.PowerShellMonitorEx | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default | ||
Comment | SupportTopic=TBD;VersionNumber=1.0.0.0; |
<UnitMonitor ID="Monitor_AK599430" Comment="SupportTopic=TBD;VersionNumber=1.0.0.0;" Accessibility="Public" Enabled="true" Target="MicrosoftKnowledgeServicesExchange2010Library!Microsoft.KnowledgeServices.Exchange.2010.ClientAccessRole" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="KnowledgeServicesLibrary!Microsoft.KnowledgeServices.Library.PowerShellMonitorEx" ConfirmDelivery="true">
<Category>Alert</Category>
<AlertSettings AlertMessage="MonitorMessage6965823af674441bb131ff409b85cbc5">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Information</AlertSeverity>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ScriptName>AK599430.ps1</ScriptName>
<Parameters>
<Parameter>
<Name>ServerName</Name>
<Value>$Target/Host/Property[Type="MicrosoftKnowledgeServicesExchange2010Library!Microsoft.KnowledgeServices.Exchange.2010.Server"]/Name$</Value>
</Parameter>
</Parameters>
<ScriptBody>
param($ServerName)
$ErrorActionPreference = "Stop"
# Set up the arguments
$scriptargs = new-object psobject
$scriptargs | add-member NoteProperty "ServerName" $ServerName
# Set up the output
$global:scriptoutput = new-object psobject
$scriptoutput | add-member NoteProperty "HasIssue" $false
#-----------------------------------------------------
# MAIN CODE SECTION
#-----------------------------------------------------
# Environment
$scriptenv = new-object psobject
$scriptenv | add-member NoteProperty "ErrorFlag" $null
$scriptenv | add-member NoteProperty "EnablePushNotifications" 0
# Helper functions
# function to get the EnablePushNotifications registry value
Function Get-EnablePushNotifications() {
$baseKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("LocalMachine", $scriptargs.ServerName)
$key = $baseKey.OpenSubKey("SYSTEM\CurrentControlSet\Services\MSExchangeRPC\ParametersSystem", $false)
if ($key -ne $null){
$ValueType = $key.GetValueKind("EnablePushNotifications")
if ($ValueType -eq "Dword"){
$ConfigFileLocation = $key.GetValue("EnablePushNotifications", 0)
}
}
$ConfigFileLocation
}
# Main function
Function AdvisorRule($scriptargs, $scriptoutput) {
# All parameters should be populated outside of the main function.
# The main function should only include the detection logic so that it can be easyly reused by the Atlanta authoring tool.
trap [Exception] {
$scriptenv.ErrorFlag = $true
continue
}
# Initialize parameters
$scriptenv.ErrorFlag = $false
$scriptenv.EnablePushNotifications = 0
$scriptoutput.HasIssue = $false
# Set parameter values
$scriptenv.EnablePushNotifications = Get-EnablePushNotifications
# Detection Logic
#If [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeRPC\ParametersSystem].EnablePushNotifications = 1
If($scriptenv.EnablePushNotifications -eq 1){
If($scriptenv.ErrorFlag -ne $true){
#Raise Alert
$scriptoutput.HasIssue = $true
}
}
}
AdvisorRule $scriptargs $scriptoutput
# set the output
$mom = new-object -comobject "MOM.ScriptAPI"
$bag = $mom.CreatePropertyBag()
if ($scriptoutput.HasIssue -ne $null)
{
$bag.AddValue("HasIssue", $scriptoutput.HasIssue)
}
$bag
</ScriptBody>
<SnapIns>
<SnapIn>Microsoft.Exchange.Management.PowerShell.E2010</SnapIn>
</SnapIns>
<TimeoutSeconds>300</TimeoutSeconds>
<Schedule>86375</Schedule>
<ErrorExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Boolean">Property[@Name='HasIssue']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="Boolean">true</Value>
</ValueExpression>
</SimpleExpression>
</ErrorExpression>
<SuccessExpression>
<Not>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Boolean">Property[@Name='HasIssue']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="Boolean">true</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</Not>
</SuccessExpression>
</Configuration>
</UnitMonitor>