Hi there
I am running the below powershell code to execute a splunk command in order to reindex 1000's of exchange POP and IMap logs which were parsed incorrectly - and need the splunk indexer to "forget" whats indexed and reindex them with the proper parsing rules - i am not sure i am executing this properly within the Invoke-Command cmdlet with -argumentlist parameter? Could use some help here please?
$i=0foreach($file in $files)
{
Invoke-Command -ComputerName $env:computername -ScriptBlock{
$splunkpath = ' C:\Program Files\SplunkUniversalForwarder\bin\splunk.exe'
Start-Process -FilePath $splunkpath -ArgumentList 'cmd btprobe -d $splunkpath/var/lib/splunk/fishbucket/splunk_private_db --file $Using:file --reset'
} -Credential $admin
$i++
Write-Host "Value of i is $i"
}