<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Email alerts from ArcGIS Server in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/email-alerts-from-arcgis-server/m-p/149281#M5945</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There's all sorts of ways to get email alerts from ArcGIS server (&lt;A class="link-titled" href="https://enterprise.arcgis.com/en/monitor/latest/administration/configure-email-notifications.htm" title="https://enterprise.arcgis.com/en/monitor/latest/administration/configure-email-notifications.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Configure email notifications—ArcGIS Monitor Administrator | ArcGIS Enterprise&lt;/A&gt;,&amp;nbsp;&lt;A href="https://community.esri.com/groups/survey123/blog/2017/11/30/a-simple-e-mail-notification-system-for-survey123-for-arcgis" target="_blank"&gt;https://community.esri.com/groups/survey123/blog/2017/11/30/a-simple-e-mail-notification-system-for-survey123-for-arcgis&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;A class="link-titled" href="https://gis.stackexchange.com/questions/64105/is-there-any-way-to-get-an-email-when-arcgis-server-services-are-stopped-down" title="https://gis.stackexchange.com/questions/64105/is-there-any-way-to-get-an-email-when-arcgis-server-services-are-stopped-down" rel="nofollow noopener noreferrer" target="_blank"&gt;python - Is there any way to get an email when ArcGIS Server services are stopped/down? - Geographic Information Systems…&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;A class="link-titled" href="http://www.vestra.com/gis/products/geosystems-monitor" title="http://www.vestra.com/gis/products/geosystems-monitor" rel="nofollow noopener noreferrer" target="_blank"&gt;GeoSystems Monitor Enterprise — Vestra&lt;/A&gt;&amp;nbsp;). This just happens to be what worked for my environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While working on another must-get-alert-when-it-happens issue, I realized how solving one problem also solves my "I want to know when ArcGIS Server hiccups problem" as well. I have quite a large GIS server farm, and it's important to me to be able to get in front of GIS server issues before my customers encounter any stop-work issues.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Creating the Powershell scripts that will harvest the events&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We need two scripts:&amp;nbsp;&lt;/P&gt;&lt;P&gt;System Events: Looking at System Events with the string "Arc" for the last year, I discovered that I'm interested in all of them except routine ArcGIS has started traffic:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;$event &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; get&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;eventlog &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;LogName System &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Message &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;Arc&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;newest &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; Where&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Object &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;$_&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Message &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;ne &lt;SPAN class="string token"&gt;"The ArcGIS Server service entered the running state."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

$PCName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $env&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;COMPUTERNAME
$EmailBody &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $event &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; format&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;list &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;property &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; out&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;string
$EmailFrom &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"$PCName sasquatch@bigfoot.com"&lt;/SPAN&gt;
$EmailTo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"you_cant_find@me.com"&lt;/SPAN&gt;
$EmailSubject &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ArcGIS Warning!!!!!!!!!!!!"&lt;/SPAN&gt;
$SMTPServer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"smtp.server"&lt;/SPAN&gt;
Write&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;host &lt;SPAN class="string token"&gt;"Sending Email"&lt;/SPAN&gt;
Send&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;MailMessage &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;From $EmailFrom &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;To $EmailTo &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Subject $EmailSubject &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;body $EmailBody &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;SmtpServer $SMTPServer‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Save this as&amp;nbsp;C:\ALERTS\ALERT_ARC_SYSTEM.ps1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Application Events:&lt;SPAN&gt;Looking at Application Events with the string "Arc" for the last year, I discovered that I'm interested in all of them except routine MsiInstaller traffic:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;$event &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; get&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;eventlog &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;LogName Application &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Message &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;Arc&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;newest &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; Where&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Object &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;$_&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Source &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;notlike &lt;SPAN class="string token"&gt;"MsiInstaller"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
$PCName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $env&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;COMPUTERNAME
$EmailBody &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $event &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; format&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;list &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;property &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; out&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;string
$EmailFrom &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"$PCName sasquatch@bigfoot.com"&lt;/SPAN&gt;
$EmailTo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"you_cant_find@me.com"&lt;/SPAN&gt;
$EmailSubject &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ArcGIS Warning!!!!!!!!!!!!"&lt;/SPAN&gt;
$SMTPServer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"smtp.server"&lt;/SPAN&gt;
Write&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;host &lt;SPAN class="string token"&gt;"Sending Email"&lt;/SPAN&gt;
Send&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;MailMessage &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;From $EmailFrom &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;To $EmailTo &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Subject $EmailSubject &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;body $EmailBody &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;SmtpServer $SMTPServer‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Save this as&amp;nbsp;&lt;SPAN&gt;Save this as&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;C:\ALERTS\ALERT_ARC_APPLICATION.ps1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The flexibility here is that you can filter whatever types of Events you want to receive an email for. Using&amp;nbsp;&lt;A class="link-titled" href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-eventlog?view=powershell-5.1" title="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-eventlog?view=powershell-5.1" rel="nofollow noopener noreferrer" target="_blank"&gt;Get-EventLog&lt;/A&gt;&amp;nbsp;properties, I'm expecting about 1-5 emails per week with the filters I'm using.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Setting up Task Scheduler to monitor the event log&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Right-click on the Application Log and select Attach a Task To this Log&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/439937_pastedImage_141.png" /&gt;&lt;/P&gt;&lt;P&gt;When you get to Action, select the PS script you created for Application Events&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/439938_pastedImage_142.png" /&gt;&lt;/P&gt;&lt;P&gt;Finish the Basic Task Wizard then go into Task Scheduler and set things up to run as a service account, etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Testing&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;From an administrative PS prompt:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;PS C&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;\Windows\system32&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; New&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;EventLog –LogName System –Source &lt;SPAN class="string token"&gt;"Test Arc System"&lt;/SPAN&gt;‍
PS C&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;\Windows\system32&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; Write&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;EventLog –LogName System –Source &lt;SPAN class="string token"&gt;"Test Arc System"&lt;/SPAN&gt; –EventID &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; –Message &lt;SPAN class="string token"&gt;"Test Arc System 4"&lt;/SPAN&gt;‍‍
PS C&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;\Windows\system32&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; New&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;EventLog –LogName Application –Source &lt;SPAN class="string token"&gt;"Test Arc"&lt;/SPAN&gt;
PS C&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;\Windows\system32&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; Write&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;EventLog –LogName Application –Source &lt;SPAN class="string token"&gt;"Test Arc"&lt;/SPAN&gt; –EventID &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; –Message &lt;SPAN class="string token"&gt;"Test Arc Application 4"&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And you should see:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/439939_pastedImage_144.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In conclusion, there are many ways to do this, and my Powershell won't get me hired as a Powershell scripter, but this should give you some ideas on how to customize and automate how you're getting ArcGIS Server alerts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Credit: I was inspired by&amp;nbsp;&lt;A class="link-titled" href="https://www.ryadel.com/en/event-viewer-send-notification-e-mail-messages-with-powershell/" title="https://www.ryadel.com/en/event-viewer-send-notification-e-mail-messages-with-powershell/" rel="nofollow noopener noreferrer" target="_blank"&gt;https://www.ryadel.com/en/event-viewer-send-notification-e-mail-messages-with-powershell/&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 08:04:23 GMT</pubDate>
    <dc:creator>ThomasColson</dc:creator>
    <dc:date>2021-12-11T08:04:23Z</dc:date>
    <item>
      <title>Email alerts from ArcGIS Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/email-alerts-from-arcgis-server/m-p/149281#M5945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There's all sorts of ways to get email alerts from ArcGIS server (&lt;A class="link-titled" href="https://enterprise.arcgis.com/en/monitor/latest/administration/configure-email-notifications.htm" title="https://enterprise.arcgis.com/en/monitor/latest/administration/configure-email-notifications.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Configure email notifications—ArcGIS Monitor Administrator | ArcGIS Enterprise&lt;/A&gt;,&amp;nbsp;&lt;A href="https://community.esri.com/groups/survey123/blog/2017/11/30/a-simple-e-mail-notification-system-for-survey123-for-arcgis" target="_blank"&gt;https://community.esri.com/groups/survey123/blog/2017/11/30/a-simple-e-mail-notification-system-for-survey123-for-arcgis&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;A class="link-titled" href="https://gis.stackexchange.com/questions/64105/is-there-any-way-to-get-an-email-when-arcgis-server-services-are-stopped-down" title="https://gis.stackexchange.com/questions/64105/is-there-any-way-to-get-an-email-when-arcgis-server-services-are-stopped-down" rel="nofollow noopener noreferrer" target="_blank"&gt;python - Is there any way to get an email when ArcGIS Server services are stopped/down? - Geographic Information Systems…&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;A class="link-titled" href="http://www.vestra.com/gis/products/geosystems-monitor" title="http://www.vestra.com/gis/products/geosystems-monitor" rel="nofollow noopener noreferrer" target="_blank"&gt;GeoSystems Monitor Enterprise — Vestra&lt;/A&gt;&amp;nbsp;). This just happens to be what worked for my environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While working on another must-get-alert-when-it-happens issue, I realized how solving one problem also solves my "I want to know when ArcGIS Server hiccups problem" as well. I have quite a large GIS server farm, and it's important to me to be able to get in front of GIS server issues before my customers encounter any stop-work issues.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Creating the Powershell scripts that will harvest the events&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We need two scripts:&amp;nbsp;&lt;/P&gt;&lt;P&gt;System Events: Looking at System Events with the string "Arc" for the last year, I discovered that I'm interested in all of them except routine ArcGIS has started traffic:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;$event &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; get&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;eventlog &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;LogName System &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Message &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;Arc&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;newest &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; Where&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Object &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;$_&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Message &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;ne &lt;SPAN class="string token"&gt;"The ArcGIS Server service entered the running state."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

$PCName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $env&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;COMPUTERNAME
$EmailBody &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $event &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; format&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;list &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;property &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; out&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;string
$EmailFrom &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"$PCName sasquatch@bigfoot.com"&lt;/SPAN&gt;
$EmailTo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"you_cant_find@me.com"&lt;/SPAN&gt;
$EmailSubject &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ArcGIS Warning!!!!!!!!!!!!"&lt;/SPAN&gt;
$SMTPServer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"smtp.server"&lt;/SPAN&gt;
Write&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;host &lt;SPAN class="string token"&gt;"Sending Email"&lt;/SPAN&gt;
Send&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;MailMessage &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;From $EmailFrom &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;To $EmailTo &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Subject $EmailSubject &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;body $EmailBody &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;SmtpServer $SMTPServer‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Save this as&amp;nbsp;C:\ALERTS\ALERT_ARC_SYSTEM.ps1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Application Events:&lt;SPAN&gt;Looking at Application Events with the string "Arc" for the last year, I discovered that I'm interested in all of them except routine MsiInstaller traffic:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;$event &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; get&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;eventlog &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;LogName Application &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Message &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;Arc&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;newest &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; Where&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Object &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;$_&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Source &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;notlike &lt;SPAN class="string token"&gt;"MsiInstaller"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
$PCName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $env&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;COMPUTERNAME
$EmailBody &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $event &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; format&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;list &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;property &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; out&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;string
$EmailFrom &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"$PCName sasquatch@bigfoot.com"&lt;/SPAN&gt;
$EmailTo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"you_cant_find@me.com"&lt;/SPAN&gt;
$EmailSubject &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ArcGIS Warning!!!!!!!!!!!!"&lt;/SPAN&gt;
$SMTPServer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"smtp.server"&lt;/SPAN&gt;
Write&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;host &lt;SPAN class="string token"&gt;"Sending Email"&lt;/SPAN&gt;
Send&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;MailMessage &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;From $EmailFrom &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;To $EmailTo &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Subject $EmailSubject &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;body $EmailBody &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;SmtpServer $SMTPServer‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Save this as&amp;nbsp;&lt;SPAN&gt;Save this as&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;C:\ALERTS\ALERT_ARC_APPLICATION.ps1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The flexibility here is that you can filter whatever types of Events you want to receive an email for. Using&amp;nbsp;&lt;A class="link-titled" href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-eventlog?view=powershell-5.1" title="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-eventlog?view=powershell-5.1" rel="nofollow noopener noreferrer" target="_blank"&gt;Get-EventLog&lt;/A&gt;&amp;nbsp;properties, I'm expecting about 1-5 emails per week with the filters I'm using.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Setting up Task Scheduler to monitor the event log&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Right-click on the Application Log and select Attach a Task To this Log&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/439937_pastedImage_141.png" /&gt;&lt;/P&gt;&lt;P&gt;When you get to Action, select the PS script you created for Application Events&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/439938_pastedImage_142.png" /&gt;&lt;/P&gt;&lt;P&gt;Finish the Basic Task Wizard then go into Task Scheduler and set things up to run as a service account, etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Testing&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;From an administrative PS prompt:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;PS C&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;\Windows\system32&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; New&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;EventLog –LogName System –Source &lt;SPAN class="string token"&gt;"Test Arc System"&lt;/SPAN&gt;‍
PS C&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;\Windows\system32&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; Write&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;EventLog –LogName System –Source &lt;SPAN class="string token"&gt;"Test Arc System"&lt;/SPAN&gt; –EventID &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; –Message &lt;SPAN class="string token"&gt;"Test Arc System 4"&lt;/SPAN&gt;‍‍
PS C&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;\Windows\system32&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; New&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;EventLog –LogName Application –Source &lt;SPAN class="string token"&gt;"Test Arc"&lt;/SPAN&gt;
PS C&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;\Windows\system32&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; Write&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;EventLog –LogName Application –Source &lt;SPAN class="string token"&gt;"Test Arc"&lt;/SPAN&gt; –EventID &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; –Message &lt;SPAN class="string token"&gt;"Test Arc Application 4"&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And you should see:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/439939_pastedImage_144.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In conclusion, there are many ways to do this, and my Powershell won't get me hired as a Powershell scripter, but this should give you some ideas on how to customize and automate how you're getting ArcGIS Server alerts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Credit: I was inspired by&amp;nbsp;&lt;A class="link-titled" href="https://www.ryadel.com/en/event-viewer-send-notification-e-mail-messages-with-powershell/" title="https://www.ryadel.com/en/event-viewer-send-notification-e-mail-messages-with-powershell/" rel="nofollow noopener noreferrer" target="_blank"&gt;https://www.ryadel.com/en/event-viewer-send-notification-e-mail-messages-with-powershell/&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:04:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/email-alerts-from-arcgis-server/m-p/149281#M5945</guid>
      <dc:creator>ThomasColson</dc:creator>
      <dc:date>2021-12-11T08:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Email alerts from ArcGIS Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/email-alerts-from-arcgis-server/m-p/149282#M5946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.wikihow.com/Send-a-Text-from-Email" title="https://www.wikihow.com/Send-a-Text-from-Email"&gt;How to Send a Text from Email: 5 Steps (with Pictures) - wikiHow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could also text yourself using this address.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FME Server is nice enough to have an alerting system built in; however it could end up emailing every ArcGIS for Server admin worldwide, as we had happen at Royal Dutch Shell.&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2019 21:52:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/email-alerts-from-arcgis-server/m-p/149282#M5946</guid>
      <dc:creator>JayJohnson6</dc:creator>
      <dc:date>2019-03-26T21:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Email alerts from ArcGIS Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/email-alerts-from-arcgis-server/m-p/149283#M5947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for tip. There are a number of things that need to be done to make this work better.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Using SMTP through &lt;SPAN style="font-family: andale mono, monospace;"&gt;Send-MailMessage &lt;/SPAN&gt;as written isn't going to work, especially if you need to use an external SMTP server like Gmail. All connections must be authenticated. We need to add password credentials and use SSL. We should even store the password in encrypted for so it's not exposed as clear text. &lt;/LI&gt;&lt;LI&gt;The way the &lt;SPAN style="font-family: andale mono, monospace;"&gt;Get-EventLog&lt;/SPAN&gt; line is composed, we'll get a message anytime the event log file is updated, even if it's not a message we care about because it always finds the last event that matched in the log, no matter how long ago that was. We can improve the Where-Object clause to limit how far back in time to consider messages as new.&lt;/LI&gt;&lt;LI&gt;This is more a coding preference, however, if there are no events found, i.e., &lt;SPAN style="font-family: andale mono, monospace;"&gt;$EmailBody&lt;/SPAN&gt; is empty/null, why even attempt to call &lt;SPAN style="font-family: andale mono, monospace;"&gt;Send-MailMessage&lt;/SPAN&gt;? It will fail, it's a waste of resources, and it's bad form to have a script that fails 99% of the time.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Here is an updated version of the &lt;SPAN style="font-family: andale mono, monospace;"&gt;ALERT_ARC_SYSTEM.ps1&lt;/SPAN&gt; script with the above issues addressed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;$PCName = "ARCGISMACHINE"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;$SRCemail = "source@company.com"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;$SMTPServer = "smtp.gmail.com"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;$SMTPPort = "587"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;# To generate encrypted password do the following first on the machine running the powershell scripts&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;# 1. Save the clear text password in a temporary password file, e.g. pwtemp.txt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;# 2. Then run:&amp;nbsp; Get-Content .\pwtemp.txt | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString &amp;gt; .\securepass.txt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;# 3. Delete clear text password file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;$pass = Get-Content C:\Alerts\securepass.txt | ConvertTo-SecureString&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;$cred = New-Object System.Management.Automation.PSCredential($SRCemail,$pass)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;$event = Get-EventLog -ComputerName $PCName -LogName System -Message *Arc* -newest 1 | Where-Object {$_.TimeGenerated -le $_.TimeGenerated.AddMinutes(-2) -and $_.Message -ne "The ArcGIS Server service entered the running state."}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;$EmailBody = $event | format-list -property * | out-string&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;if (!([string]::IsNullOrEmpty($EmailBody))) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $EmailFrom = "$PCName $SRCemail"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $EmailTo = "destination1@compay.com", "destination2@company.com"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $EmailSubject = "ArcGIS Warning!!!!"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-host "Sending Email"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Send-MailMessage -From $EmailFrom -To $EmailTo -Subject $EmailSubject -body "$EmailBody" -SmtpServer $SMTPServer -Port $SMTPPort -UseSsl -Credential $cred&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace; font-size: 13px;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2020 21:42:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/email-alerts-from-arcgis-server/m-p/149283#M5947</guid>
      <dc:creator>MarkHougaard</dc:creator>
      <dc:date>2020-06-23T21:42:10Z</dc:date>
    </item>
  </channel>
</rss>

