<?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 Re: How can I make the Powershell add-on script's run on a schedule? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-make-the-Powershell-add-on-script-s-run-on-a-schedule/m-p/358316#M65408</link>
    <description>&lt;P&gt;I'm having a similar issue.  Basically I've configured it to run every 5 minutes (splunkd doesn't say it's an invalid cron), however it only runs once at start.  Sometimes it will run once at start, and then 5 minutes later (so I know the cron is correct) but then never again.  If I do it the old way (i.e. cmd and invoking powershell) it works fine.&lt;/P&gt;</description>
    <pubDate>Sat, 05 May 2018 00:35:45 GMT</pubDate>
    <dc:creator>Kendo213</dc:creator>
    <dc:date>2018-05-05T00:35:45Z</dc:date>
    <item>
      <title>How can I make the Powershell add-on script's run on a schedule?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-make-the-Powershell-add-on-script-s-run-on-a-schedule/m-p/358313#M65405</link>
      <description>&lt;P&gt;I have an add-on that I'm deploying  on Windows systems. inputs.conf looks like this:&lt;BR /&gt;
  &lt;CODE&gt;[powershell://Processes-EX1]&lt;/CODE&gt;&lt;BR /&gt;
  &lt;CODE&gt;script = . "C:\Program Files\SplunkUniversalForwarder\etc\apps\Powershell_add_on\bin\Get-Policies.ps1&lt;/CODE&gt;&lt;BR /&gt;
  &lt;CODE&gt;schedule = 0 * * *&lt;/CODE&gt;&lt;BR /&gt;
  &lt;CODE&gt;sourcetype = WindowsPowershell&lt;/CODE&gt;&lt;BR /&gt;
  &lt;CODE&gt;index = test&lt;/CODE&gt;&lt;BR /&gt;
  &lt;CODE&gt;disabled = 0&lt;/CODE&gt;&lt;BR /&gt;
I want this to run at every minute 0, every hour. &lt;BR /&gt;
But It runs only once when I start Universal Forwarder. Then, when I restart forwarder, it runs again and only once. When forwarder is working for 2 or more hours(script should run at least 2 times) just nothing happens. &lt;BR /&gt;
How can I make scripts run on schedule?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 13:18:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-make-the-Powershell-add-on-script-s-run-on-a-schedule/m-p/358313#M65405</guid>
      <dc:creator>eduardKiyko</dc:creator>
      <dc:date>2018-04-24T13:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make the Powershell add-on script's run on a schedule?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-make-the-Powershell-add-on-script-s-run-on-a-schedule/m-p/358314#M65406</link>
      <description>&lt;P&gt;I'm encountering the same issue.  Did you find a resolution?&lt;/P&gt;</description>
      <pubDate>Sat, 05 May 2018 00:16:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-make-the-Powershell-add-on-script-s-run-on-a-schedule/m-p/358314#M65406</guid>
      <dc:creator>Kendo213</dc:creator>
      <dc:date>2018-05-05T00:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make the Powershell add-on script's run on a schedule?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-make-the-Powershell-add-on-script-s-run-on-a-schedule/m-p/358315#M65407</link>
      <description>&lt;P&gt;Nope, not yet.  Using Task Scheduler for now... (It's only on one machine.)&lt;/P&gt;</description>
      <pubDate>Sat, 05 May 2018 00:26:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-make-the-Powershell-add-on-script-s-run-on-a-schedule/m-p/358315#M65407</guid>
      <dc:creator>paulathome</dc:creator>
      <dc:date>2018-05-05T00:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make the Powershell add-on script's run on a schedule?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-make-the-Powershell-add-on-script-s-run-on-a-schedule/m-p/358316#M65408</link>
      <description>&lt;P&gt;I'm having a similar issue.  Basically I've configured it to run every 5 minutes (splunkd doesn't say it's an invalid cron), however it only runs once at start.  Sometimes it will run once at start, and then 5 minutes later (so I know the cron is correct) but then never again.  If I do it the old way (i.e. cmd and invoking powershell) it works fine.&lt;/P&gt;</description>
      <pubDate>Sat, 05 May 2018 00:35:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-make-the-Powershell-add-on-script-s-run-on-a-schedule/m-p/358316#M65408</guid>
      <dc:creator>Kendo213</dc:creator>
      <dc:date>2018-05-05T00:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make the Powershell add-on script's run on a schedule?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-make-the-Powershell-add-on-script-s-run-on-a-schedule/m-p/358317#M65409</link>
      <description>&lt;P&gt;In the inputs.conf make the following entry to run it every 30 mins (30*60). default is 5 mins.&lt;/P&gt;

&lt;P&gt;interval = 1800&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.1/Admin/Inputsconf"&gt;https://docs.splunk.com/Documentation/Splunk/7.1.1/Admin/Inputsconf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jun 2018 20:15:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-make-the-Powershell-add-on-script-s-run-on-a-schedule/m-p/358317#M65409</guid>
      <dc:creator>kamal_jagga</dc:creator>
      <dc:date>2018-06-24T20:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make the Powershell add-on script's run on a schedule?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-make-the-Powershell-add-on-script-s-run-on-a-schedule/m-p/358318#M65410</link>
      <description>&lt;P&gt;Hi eduardKiyko,&lt;/P&gt;

&lt;P&gt;looking at your &lt;CODE&gt;schedule = 0 * * *&lt;/CODE&gt; entry it looks like your are missing one additional &lt;CODE&gt;*&lt;/CODE&gt; . Therefore this is not a valid cron schedule and Splunk uses the default option for schedule. From the docs &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf&lt;/A&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;schedule = [&amp;lt;number&amp;gt;|&amp;lt;cron schedule&amp;gt;]
* How often to run the specified PowerShell command or script.
* You can specify a number in seconds, or provide a valid cron
  schedule.
* Defaults to running the command or script once, at startup.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Find more details on valid cron notation here &lt;A href="https://en.wikipedia.org/wiki/Cron#Overview"&gt;https://en.wikipedia.org/wiki/Cron#Overview&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jun 2018 20:44:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-make-the-Powershell-add-on-script-s-run-on-a-schedule/m-p/358318#M65410</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2018-06-24T20:44:16Z</dc:date>
    </item>
  </channel>
</rss>

