AK599430

Monitor_AK599430 (UnitMonitor)

Exchange Server EnablePushNotifications is enabled

Knowledge Base article:

External

http://go.microsoft.com/fwlink/?LinkId=251674

Element properties:

TargetMicrosoft.KnowledgeServices.Exchange.2010.ClientAccessRole
Parent MonitorSystem.Health.ConfigurationState
CategoryAlert
EnabledTrue
Alert GenerateTrue
Alert SeverityInformation
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.KnowledgeServices.Library.PowerShellMonitorEx
RemotableTrue
AccessibilityPublic
Alert Message
Exchange Server EnablePushNotifications is enabled
<Details>
<Content>A registry subkey has been created to enable the UDP notifications support feature. Outlook 2003 uses UDP notifications as the primary method for receiving notifications from an Exchange server. For more information and instructions to identify if push notifications work, follow the steps in the Knowledge Base article.</Content>
<CollectedInformation />
</Details>
RunAsDefault
CommentSupportTopic=TBD;VersionNumber=1.0.0.0;

Source Code:

<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><Script>


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

</Script></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>