Is there a way to get parallel execution of parallel work (multithreading)? I have about 200 servers that need to be started, and I was wondering if there is a way to check, for example, 10 servers at the same time, and not one at a time ... WMI very slowly checks it at a time.
clear Write-Host "Script to Check if Server is Alive and Simple WMI Check" $servers = Get-Content -Path c:\Temp\Servers.txt foreach($server in $servers) { if (Test-Connection -ComputerName $server -Quiet) { $wmi = (Get-WmiObject -Class Win32_ComputerSystem -ComputerName $server).Name Write-Host "$server responds: WMI reports the name is: $wmi" } else { Write-Host "***$server ERROR - Not responding***" } }
source share