$off = @()
Import-Csv $args[0] | ForEach {
If (Test-Connection $_.ComputerName -Count 1 -Quiet) {
$on += $($_.ComputerName)
} else {
$off += $($_.ComputerName)
}
}
write-host "The Following Computers are Turned On"
$on | Out-String
write-host "The Following Computers are Turned Off"
$off | Out-String
CSV Example
ComputerName
pc1.domain.com
pc2.domain.com