If this is something that you need to run on a regular basis, like every month, then I would recommend setting up a scheduled task on each machine to run the program.
If you only need to run this when requested, then you can use Powershell's Invoke-Command to execute the program.
$servers = get-content -Path c:\temp\ServerList.txt # read in the list of servers
# If the account that the script is running as does not have admin access on the server,
# Then you will need to use a credential object in order to authenticate
$User = ".\admin"
$PWord = ConvertTo-SecureString -String "admin" -AsPlainText -Force # the account's password
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $PWord
#This is the script block that runs on each remote machine
$sb = {
# Run the logger program on the remote machine and save the file to its c drive.
c:\LogTool\Connectionlogexport.exe -output "c:\LogTool\$env:COMPUTERNAME.csv"
}
#Process our list of servers
foreach ($Name in $servers) {
Invoke-Command -ComputerName $Name -ScriptBlock $sb -Credential $Credential
$dataFile = "\\$Name\SomeSharedFolder\$Name.csv"
if (test-path $dataFile) {
# We have to initiate the file copy on the server where the script is running because
# we can't push it with the scriptblock due to the double hop problem.
Copy-Item $dataFile -Destination "C:\Data\"
"We got the data for $name"
} else {
"Error, we did not find $dataFile"
}
}
If you have not configured remoting, then on each machine you will need to run "winrm quickconfig" to do that.