I could use some assistance with adding the parallel processing code to this script. I suppose I just do not understnad powershell enough yet to understand where and what I add the necessary code....I am trying to figure it out but the light bulb is not on just yet...:-)
Start-Transcript C:\temp\agent.log -IncludeInvocationHeader
$computers = gc "C:\temp\list.txt"
$source = "\\pathtodfsrootstore"
$dest = "c$\windows\temp\test2533212"
foreach ($computer in $computers) {
foreach (if (Test-Connection -Cn $computer -count 1 -quiet) {
Copy-Item -Force $source -Destination \\$computer\$dest -Recurse
#psexec.exe \\$computer cmd /c "c:\windows\temp\testv2533212\test.bat"
} else {
Write-output "$computer is not online"
}
}
Stop-Transcript