How to ping multiple computers by using windows PowerShell
$COMPUTERS = GET-CONTENT C:\users\manager.lab\Desktop\powershell\powershell\pingmultiplecomputers\In.txt
foreach ($computer in $computers)
{
Write-Host "Processing machine $($Computer)......"
Test-Connection $Computers -count 1| Out-File C:\users\manager.lab\Desktop\powershell\powershell\pingmultiplecomputers\out.txt
}
foreach ($computer in $computers)
{
Write-Host "Processing machine $($Computer)......"
Test-Connection $Computers -count 1| Out-File C:\users\manager.lab\Desktop\powershell\powershell\pingmultiplecomputers\out.txt
}
0 comments:
Post a Comment