Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

count responding devices using test-Connection then output to html

$
0
0

Hi
I am trying to count the total responding computers using the script below which doesn't not work. I get the total computers found. I do not want to reference a list or txt file

Import-ModuleActiveDirectory
$computers=Get-ADComputer-Filter {OperatingSystem-notLike"*server*"}
ForEach ($computerin$computers) {

 

 

 

 

$client

 

 

=$Computer.Name

if

 

 

(Test-Connection-Computername$client-BufferSize16-Count1-Quiet) {
 
}

}

 

 

($computer|Measure-Object).count | out-file c:\online.html

 

I want to display the results on our intranet to show staff how many computers are left on.

 

Thanks in advance


Viewing all articles
Browse latest Browse all 6937

Trending Articles