<?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: Restarting Splunk Forwarders with Powershell in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Restarting-Splunk-Forwarders-with-Powershell/m-p/75263#M15355</link>
    <description>&lt;P&gt;for some reason the backslashes get removed from this thread. they are all there for the directory names.&lt;/P&gt;</description>
    <pubDate>Mon, 31 Dec 2012 21:58:18 GMT</pubDate>
    <dc:creator>zacharyhatsis</dc:creator>
    <dc:date>2012-12-31T21:58:18Z</dc:date>
    <item>
      <title>Restarting Splunk Forwarders with Powershell</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Restarting-Splunk-Forwarders-with-Powershell/m-p/75262#M15354</link>
      <description>&lt;P&gt;Can anyone give me some insight into why this script might not be working? I'm fairly new to powershell, so i'm sure its somethign simple: &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;$serverlist =&lt;BR /&gt;
"C:\Users\zh\Desktop\serverlist.txt"&lt;BR /&gt;
Get-Content $serverlist |&lt;BR /&gt;
foreach($comp in&lt;BR /&gt;
$serverlist){Invoke-Command&lt;BR /&gt;
-ComputerName $_ -FilePath "C:\Program Files\SplunkUniversalForwarder\bin\splunk.exe"&lt;BR /&gt;
-ArgumentList restart -verbose}&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I tried using the splunk powershell kit, and didn't have a lot of luck getting the commands to work without debugging it, so I figured this shoudl be a simple one-liner on powershell to fix on my own rather than debugging the kit. Thanks! &lt;/P&gt;</description>
      <pubDate>Mon, 31 Dec 2012 21:32:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Restarting-Splunk-Forwarders-with-Powershell/m-p/75262#M15354</guid>
      <dc:creator>zacharyhatsis</dc:creator>
      <dc:date>2012-12-31T21:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Restarting Splunk Forwarders with Powershell</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Restarting-Splunk-Forwarders-with-Powershell/m-p/75263#M15355</link>
      <description>&lt;P&gt;for some reason the backslashes get removed from this thread. they are all there for the directory names.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Dec 2012 21:58:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Restarting-Splunk-Forwarders-with-Powershell/m-p/75263#M15355</guid>
      <dc:creator>zacharyhatsis</dc:creator>
      <dc:date>2012-12-31T21:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Restarting Splunk Forwarders with Powershell</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Restarting-Splunk-Forwarders-with-Powershell/m-p/75264#M15356</link>
      <description>&lt;P&gt;FYI, you can either escape the slashes in your answer or highlight the "code" portion of your answer and click the "code sample" (1s and 0s) button on the formatting menu.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Dec 2012 22:10:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Restarting-Splunk-Forwarders-with-Powershell/m-p/75264#M15356</guid>
      <dc:creator>sbrant_splunk</dc:creator>
      <dc:date>2012-12-31T22:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Restarting Splunk Forwarders with Powershell</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Restarting-Splunk-Forwarders-with-Powershell/m-p/75265#M15357</link>
      <description>&lt;P&gt;&lt;CODE&gt;$serverlist = "C:\Users\zh\Desktop\serverlist.txt"&lt;BR /&gt;
    foreach ($server in Get-Content $serverlist) {Invoke-Command -ScriptBlock {"C:\program files\splunkuniversalforwarder\bin\splunk.exe restart"} -ComputerName $server -verbose}&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Dec 2012 22:35:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Restarting-Splunk-Forwarders-with-Powershell/m-p/75265#M15357</guid>
      <dc:creator>zacharyhatsis</dc:creator>
      <dc:date>2012-12-31T22:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Restarting Splunk Forwarders with Powershell</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Restarting-Splunk-Forwarders-with-Powershell/m-p/75266#M15358</link>
      <description>&lt;P&gt;Try "restart-service splunk*" instead of "-FilePath "C:Program FilesSplunkUniversalForwarderbinsplunk.exe"&lt;BR /&gt;
-ArgumentList restart -verbose"&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jan 2013 15:44:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Restarting-Splunk-Forwarders-with-Powershell/m-p/75266#M15358</guid>
      <dc:creator>bdlabs</dc:creator>
      <dc:date>2013-01-01T15:44:00Z</dc:date>
    </item>
  </channel>
</rss>

