<?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: Powershell input for Splunk universal forwarder - Windows Server in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Powershell-input-for-Splunk-universal-forwarder-Windows-Server/m-p/164940#M33463</link>
    <description>&lt;P&gt;The link readme link in the body of this post is missing the last "E", it should be: &lt;A href="https://github.com/splunk/splunk-powershell-modularinput/tree/master/Package/README"&gt;https://github.com/splunk/splunk-powershell-modularinput/tree/master/Package/README&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jan 2017 21:19:58 GMT</pubDate>
    <dc:creator>rmillerscjcom</dc:creator>
    <dc:date>2017-01-13T21:19:58Z</dc:date>
    <item>
      <title>Powershell input for Splunk universal forwarder - Windows Server</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Powershell-input-for-Splunk-universal-forwarder-Windows-Server/m-p/164936#M33459</link>
      <description>&lt;P&gt;I am just trying to create a dashboard which shows Windows System information (like Task Manager)&lt;/P&gt;

&lt;P&gt;Powershell script:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Get-Process  | Where-Object {$_.ws -gt 0MB} | ForEach-Object -Begin {
    $Owner = Get-WmiObject -Class Win32_Process
} -Process {
    $ID = $_.Id
    New-Object -TypeName 'PSCustomObject' -Property @{
        'UserName' = ($Owner | Where-Object {$_.ProcessID -eq $ID}).GetOwner().User
        'DomainName' = ($Owner | Where-Object {$_.ProcessID -eq $ID}).GetOwner().Domain
        'ProcessName' = $_.ProcessName
        'MemoryUsed' = "{0:N2} MB" -f ($_.WS / 1MB)
    } | Select-Object -Property UserName,DomainName,ProcessName,MemoryUsed
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Output of the script:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;UserName               DomainName           ProcessName       MemoryUsed
---------              ----------           -----------       ----------
NETWORK SERVICE        NYYYY                chrome            6.61 MB
SYSTEM                 NYYYY                Explorer          17.80 MB
User1                  CCTTT                cmd               9.65 MB
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The Script runs fine and Exeution-Policy are set to Remote-Signed&lt;BR /&gt;&lt;BR /&gt;
I set the inputs.conf to read the Script at bin directory, but unable to get the output as expected? Does any modifications needed at script ?&lt;BR /&gt;&lt;BR /&gt;
I created a .cmd file to open the powershell script and placed both the .ps1 &amp;amp; .cmd at /bin directory&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;&lt;U&gt;Inputs.conf&lt;/U&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://E:\APPS\SplunkUniversalForwarder\etc\apps\MSICreated\bin\Status.cmd]
interval = 0
sourcetype = winperf
index = main
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Feb 2014 16:30:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Powershell-input-for-Splunk-universal-forwarder-Windows-Server/m-p/164936#M33459</guid>
      <dc:creator>chimbudp</dc:creator>
      <dc:date>2014-02-25T16:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell input for Splunk universal forwarder - Windows Server</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Powershell-input-for-Splunk-universal-forwarder-Windows-Server/m-p/164937#M33460</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
Put the scripts in bin/script folder&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://$SPLUNK_HOME\etc\apps\MSICreated\bin\scripts\Status.cmd]
interval = 0
sourcetype = winperf
index = main
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Status.cmd  should have:   &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; @powershell -File E:\Apps\SplunkUniversalForwarder\etc\apps\MSICreated\bin\scripts\Status.ps1 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 19:33:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Powershell-input-for-Splunk-universal-forwarder-Windows-Server/m-p/164937#M33460</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-02-25T19:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell input for Splunk universal forwarder - Windows Server</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Powershell-input-for-Splunk-universal-forwarder-Windows-Server/m-p/164938#M33461</link>
      <description>&lt;P&gt;You should try the &lt;A href="http://apps.splunk.com/app/1477/"&gt;PowerShell Addon&lt;/A&gt;, I think you'll have a better experience with it. The addon is a PowerShell host, implemented as a Splunk modular input. &lt;/P&gt;

&lt;P&gt;Be sure to &lt;A href="https://github.com/splunk/splunk-powershell-modularinput/tree/master/Package/README"&gt;read the README,&lt;/A&gt; there are some caveats. But it's a cool solution, and the basis for several Splunk Apps like MS Exchange. No more creating a .cmd file to launch powershell.exe. You can even embed bare PowerShell statements in inputs.conf.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 21:12:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Powershell-input-for-Splunk-universal-forwarder-Windows-Server/m-p/164938#M33461</guid>
      <dc:creator>halr9000</dc:creator>
      <dc:date>2014-02-25T21:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell input for Splunk universal forwarder - Windows Server</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Powershell-input-for-Splunk-universal-forwarder-Windows-Server/m-p/164939#M33462</link>
      <description>&lt;P&gt;thanks  abhi..&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 22:05:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Powershell-input-for-Splunk-universal-forwarder-Windows-Server/m-p/164939#M33462</guid>
      <dc:creator>chimbudp</dc:creator>
      <dc:date>2014-02-25T22:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell input for Splunk universal forwarder - Windows Server</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Powershell-input-for-Splunk-universal-forwarder-Windows-Server/m-p/164940#M33463</link>
      <description>&lt;P&gt;The link readme link in the body of this post is missing the last "E", it should be: &lt;A href="https://github.com/splunk/splunk-powershell-modularinput/tree/master/Package/README"&gt;https://github.com/splunk/splunk-powershell-modularinput/tree/master/Package/README&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 21:19:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Powershell-input-for-Splunk-universal-forwarder-Windows-Server/m-p/164940#M33463</guid>
      <dc:creator>rmillerscjcom</dc:creator>
      <dc:date>2017-01-13T21:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell input for Splunk universal forwarder - Windows Server</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Powershell-input-for-Splunk-universal-forwarder-Windows-Server/m-p/164941#M33464</link>
      <description>&lt;P&gt;For powershell if you want to do it via the input file. You will need a path file, this is the easiest solution.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;step 1 create a script and store it in a directory. For this example i will use C:\temp\bin\test.ps1&lt;/LI&gt;
&lt;LI&gt;Step 2 create a path file(file.path). C:\temp\bin\testpath.path&lt;/LI&gt;
&lt;LI&gt;Step 3 Store this in your path file . Store this in the path
$SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe -command  " C:\temp\bin\test.ps1'"&lt;/LI&gt;
&lt;LI&gt;Step 4 Create the inputs.conf file&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 08 Mar 2018 22:27:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Powershell-input-for-Splunk-universal-forwarder-Windows-Server/m-p/164941#M33464</guid>
      <dc:creator>afamoyib</dc:creator>
      <dc:date>2018-03-08T22:27:04Z</dc:date>
    </item>
  </channel>
</rss>

