asked on
$ServerName = Get-Content .\LondonComps.txt, .\Singaporecomps.txt, .\usacomps.txt, .\RomaniaComps.txt
foreach ($Server in $ServerName) {
if (Test-Connection -ComputerName $Server -Count 2 -Quiet ) {
write-Host "$Server is alive and Pinging " -ForegroundColor Green
Get-Service *masvc*, *entercept*, *McAfeeFramework* -ComputerName $Server | select Status, DisplayName, Machinename
} else
{ Write-Warning "$Server seems dead not pinging"
}
}