Splunk Dev

Powershell scripting

MikeBertelsen
Communicator

Just starting to look at this but any help here is appreciated.
A coworker asked me the following:
Mike, I was trying to work on a PowerShell script I wanted to be able to query Splunk. I pulled open one of my old queries that is being utilized now as automated process to start testing and it appears even when I run that known working script I get I believe connection errors.

Invoke-HTTPPost : Exception calling "GetRequestStream" with "0" argument(s): "The operation has timed out"
At C:\Users\marks\Documents\WindowsPowerShell\Modules\Splunk\Splunk-Core\Splunk-Core.psm1:591 char:62
+ "POST" { $xml = Invoke-HTTPPost ...
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-HTTPPost

Get-SplunkAuthToken : [Get-SplunkAuthToken] :: No value returned from Server [servernamehere]
At C:\Users\marks\Documents\WindowsPowerShell\Modules\Splunk\Splunk-Authentication\Splunk-Authentication.psm1:127 char:21
+ $AuthTokenObject = Get-SplunkAuthToken @GetSplunkAuthTokenParams
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-SplunkAuthToken

Invoke-HTTPPost : Exception calling "GetRequestStream" with "0" argument(s): "The operation has timed out"
At C:\Users\marks\Documents\WindowsPowerShell\Modules\Splunk\Splunk-Core\Splunk-Core.psm1:579 char:62
+ "POST" { $xml = Invoke-HTTPPost ...
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-HTTPPost

0 Karma
Get Updates on the Splunk Community!

App Platform's 2025 Year in Review: A Year of Innovation, Growth, and Community

As we step into 2026, it’s the perfect moment to reflect on what an extraordinary year 2025 was for the Splunk ...

Operationalizing Entity Risk Score with Enterprise Security 8.3+

Overview Enterprise Security 8.3 introduces a powerful new feature called “Entity Risk Scoring” (ERS) for ...

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...