troubleshooting Question

Powershell script reporting

Avatar of Kelly Garcia
Kelly GarciaFlag for United Kingdom of Great Britain and Northern Ireland asked on
PowershellAnti-Virus Apps
12 Comments1 Solution219 ViewsLast Modified:
Hi Guys,

I have written the script below to check all machines in our asset register that they have McAfee agent and hips installed, any suggestions for improvement will be greatly appreciate:

$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" 


I want the results to be on Microsoft excel on whether the service is running or not which will indicate that the product is installed on the machine or not. please help I am unsure how to do this.

thank you in advance,
Join our community to see this answer!
Unlock 1 Answer and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros