<?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: Splunk Powershell Module - Why was connection closed unexpectedly? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Powershell-Module-Why-was-connection-closed-unexpectedly/m-p/160329#M14809</link>
    <description>&lt;P&gt;I couldn't post the answer to this because my account is new.  But it was 2 fold:&lt;/P&gt;

&lt;P&gt;The management port uses https even when the web portal is set to only use http which threw me off.  So the first step was specifying the protocol as https instead of http&lt;/P&gt;

&lt;P&gt;The second issue was the self-signed cert which can be fixed by running the command "disable-certificatevalidation" which is apart of the Splunk module.&lt;/P&gt;

&lt;P&gt;Hope that helps for anyone else who might have been in the same situation&lt;/P&gt;</description>
    <pubDate>Fri, 15 Aug 2014 21:26:32 GMT</pubDate>
    <dc:creator>kypife</dc:creator>
    <dc:date>2014-08-15T21:26:32Z</dc:date>
    <item>
      <title>Splunk Powershell Module - Why was connection closed unexpectedly?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Powershell-Module-Why-was-connection-closed-unexpectedly/m-p/160325#M14805</link>
      <description>&lt;P&gt;Hi all.  I am trying to use the Splunk Powershell module to be able to query our server after agent installations to verify that they are reporting correctly instead of logging into the web portal to check.&lt;/P&gt;

&lt;P&gt;When I try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;connect-splunk -ComputerName $splunkServer -Protocol http -Port $port -Credential $cred -Verbose
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get the following error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Invoke-HTTPPost : Exception calling "GetRequestStream" with "0" argument(s): "The underlying connection was closed: The connection 
was closed unexpectedly."
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tried using the default port, both http and https protocols as well, but nothing works.  Also, this will fail immediately without a delay (where-as changing the protocol will cause a timeout error message).  To me, it appears that this path does not exist.  &lt;/P&gt;

&lt;P&gt;SplunkServer:5617/services/auth/login&lt;/P&gt;

&lt;P&gt;If I enter the url into the browser, I get a "Page Cannot Be Displayed" error.  If I go straight to SplunkServer though, the url is this:&lt;/P&gt;

&lt;P&gt;SplunkServer/en-US/account/login?return_to=%2Fen-US%2F&lt;/P&gt;

&lt;P&gt;Do I need to tweak some settings in the module?  Or might this not be compatible with the version of Splunk I have?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2014 21:02:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Powershell-Module-Why-was-connection-closed-unexpectedly/m-p/160325#M14805</guid>
      <dc:creator>kypife</dc:creator>
      <dc:date>2014-07-28T21:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Powershell Module - Why was connection closed unexpectedly?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Powershell-Module-Why-was-connection-closed-unexpectedly/m-p/160326#M14806</link>
      <description>&lt;P&gt;Does your Splunk install use the default ports, or not? Where does 5617 come from? Default is 8000 for humans, and 8089 for REST API. Modify your question to add this detail please.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2014 15:26:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Powershell-Module-Why-was-connection-closed-unexpectedly/m-p/160326#M14806</guid>
      <dc:creator>halr9000</dc:creator>
      <dc:date>2014-07-30T15:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Powershell Module - Why was connection closed unexpectedly?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Powershell-Module-Why-was-connection-closed-unexpectedly/m-p/160327#M14807</link>
      <description>&lt;P&gt;No it doesn't use the default ports.  The splunk agents report on port 5617.  When I try port 8000 or 8089 it times out.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jul 2014 15:06:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Powershell-Module-Why-was-connection-closed-unexpectedly/m-p/160327#M14807</guid>
      <dc:creator>kypife</dc:creator>
      <dc:date>2014-07-31T15:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Powershell Module - Why was connection closed unexpectedly?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Powershell-Module-Why-was-connection-closed-unexpectedly/m-p/160328#M14808</link>
      <description>&lt;P&gt;What version of Splunk? If using the admin user account, have you changed the password from the default? If not, try changing the password, as I think I recall a policy that restricts certain REST endpoints when the default password is present.&lt;/P&gt;

&lt;P&gt;Are you using the default self-signed SSL cert, or have you installed your own "real" one? PowerShell doesn't like self-signed certs, this could be related to your problem, although I would expect the error message to say so, e.g.:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Invoke-HTTPPost : Exception calling "GetRequestStream" with "0" argument(s): "The underlying connection was closed:
Could not establish trust relationship for the SSL/TLS secure channel."
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also try looking at the exception details. Here's an example of mine, but I'm not able to repro your issue.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;PS C:\Users\Hal&amp;gt; $error[0] | Format-List * -Force

writeErrorStream      : True
PSMessageDetails      :
Exception             : Microsoft.PowerShell.Commands.WriteErrorException: Exception calling "GetRequestStream" with
                        "0" argument(s): "The underlying connection was closed: Could not establish trust relationship
                        for the SSL/TLS secure channel."
TargetObject          :
CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-HTTPPost
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at Invoke-HTTPPost,
                        C:\Users\Hal\SkyDrive\PowerShell\Modules\Splunk\Splunk-Core\Splunk-Core.psm1: line 280
                        at Invoke-SplunkAPIRequest,
                        C:\Users\Hal\SkyDrive\PowerShell\Modules\Splunk\Splunk-Core\Splunk-Core.psm1: line 599
                        at Get-SplunkAuthToken, C:\Users\Hal\SkyDrive\PowerShell\Modules\Splunk\Splunk-Authentication\S
                        plunk-Authentication.psm1: line 334
                        at Connect-Splunk, C:\Users\Hal\SkyDrive\PowerShell\Modules\Splunk\Splunk-Authentication\Splunk
                        -Authentication.psm1: line 127
                        at &amp;lt;ScriptBlock&amp;gt;, &amp;lt;No file&amp;gt;: line 1
PipelineIterationInfo : {0, 1}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Aug 2014 14:18:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Powershell-Module-Why-was-connection-closed-unexpectedly/m-p/160328#M14808</guid>
      <dc:creator>halr9000</dc:creator>
      <dc:date>2014-08-07T14:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Powershell Module - Why was connection closed unexpectedly?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Powershell-Module-Why-was-connection-closed-unexpectedly/m-p/160329#M14809</link>
      <description>&lt;P&gt;I couldn't post the answer to this because my account is new.  But it was 2 fold:&lt;/P&gt;

&lt;P&gt;The management port uses https even when the web portal is set to only use http which threw me off.  So the first step was specifying the protocol as https instead of http&lt;/P&gt;

&lt;P&gt;The second issue was the self-signed cert which can be fixed by running the command "disable-certificatevalidation" which is apart of the Splunk module.&lt;/P&gt;

&lt;P&gt;Hope that helps for anyone else who might have been in the same situation&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2014 21:26:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Powershell-Module-Why-was-connection-closed-unexpectedly/m-p/160329#M14809</guid>
      <dc:creator>kypife</dc:creator>
      <dc:date>2014-08-15T21:26:32Z</dc:date>
    </item>
  </channel>
</rss>

