<?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 How to monitor Powershell Command Line history? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-monitor-Powershell-Command-Line-history/m-p/377098#M68240</link>
    <description>&lt;P&gt;I enabled the powershell logging function on WinServer2k8 or Winserver2012 in following steps&lt;/P&gt;

&lt;P&gt;create  a default profile:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;C:\Windows\System32\WindowsPowerShell\v1.0\Profile.ps1&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Add  these to default profile.ps1 file&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$LogCommandHealthEvent  =   $true   
$LogCommandLifecycleEvent   =   $true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then I try executing a powershell command  in powershell window,I can see this record in the event viewer.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5452i207138DF97459B15/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Now ,I will use splunk forwarder push that to splunk , I created following inputs.conf stanza:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;c:\program files\splunk forwarder\apps\splunk_TA_Windows\local\inputs.conf&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[WinEventLog://Windows Powershell]
disabled=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;`&lt;BR /&gt;
I also tried the following inputs&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [WinEventLog://Microsoft-Windows-Powershell/Operational]
disabled=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Splunk can't receive the PowerShell log，However, I can receive Windows Security log, so I think I might input Invalid stanza in inputs.conf  and I can't find an error that related inputs from internal log&lt;/P&gt;

&lt;P&gt;Who can tell me how to create inputs stanza correctly?&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jul 2018 06:48:30 GMT</pubDate>
    <dc:creator>bestSplunker</dc:creator>
    <dc:date>2018-07-27T06:48:30Z</dc:date>
    <item>
      <title>How to monitor Powershell Command Line history?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-monitor-Powershell-Command-Line-history/m-p/377098#M68240</link>
      <description>&lt;P&gt;I enabled the powershell logging function on WinServer2k8 or Winserver2012 in following steps&lt;/P&gt;

&lt;P&gt;create  a default profile:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;C:\Windows\System32\WindowsPowerShell\v1.0\Profile.ps1&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Add  these to default profile.ps1 file&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$LogCommandHealthEvent  =   $true   
$LogCommandLifecycleEvent   =   $true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then I try executing a powershell command  in powershell window,I can see this record in the event viewer.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5452i207138DF97459B15/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Now ,I will use splunk forwarder push that to splunk , I created following inputs.conf stanza:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;c:\program files\splunk forwarder\apps\splunk_TA_Windows\local\inputs.conf&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[WinEventLog://Windows Powershell]
disabled=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;`&lt;BR /&gt;
I also tried the following inputs&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [WinEventLog://Microsoft-Windows-Powershell/Operational]
disabled=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Splunk can't receive the PowerShell log，However, I can receive Windows Security log, so I think I might input Invalid stanza in inputs.conf  and I can't find an error that related inputs from internal log&lt;/P&gt;

&lt;P&gt;Who can tell me how to create inputs stanza correctly?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 06:48:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-monitor-Powershell-Command-Line-history/m-p/377098#M68240</guid>
      <dc:creator>bestSplunker</dc:creator>
      <dc:date>2018-07-27T06:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to monitor Powershell Command Line history?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-monitor-Powershell-Command-Line-history/m-p/377099#M68241</link>
      <description>&lt;P&gt;I've solved this problem. I found doc related  it: &lt;CODE&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.1/Data/MonitorWindowsdata#Configure_remote_event_log_monitoring" target="test_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.1/Data/MonitorWindowsdata#Configure_remote_event_log_monitoring&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Note: Use the log properties' "Full Name:" to index. For example, to monitor Task Scheduler in Microsoft&amp;gt; Windows &amp;gt; TaskScheduler &amp;gt;Operational, right click on Operational and select properties. Use the "Full Name" to append to WinEventLog:// stanza:
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So the correct configuration should is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[WinEventLog://Windows PowerShell]
disabled = 0
index=wineventlog
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm used to search &lt;CODE&gt;wineventlog&lt;/CODE&gt; index, but these events are default indexed into the index &lt;CODE&gt;main&lt;/CODE&gt;  if you do not configure the index name.So&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 02:35:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-monitor-Powershell-Command-Line-history/m-p/377099#M68241</guid>
      <dc:creator>bestSplunker</dc:creator>
      <dc:date>2018-07-31T02:35:13Z</dc:date>
    </item>
  </channel>
</rss>

