top of page

PowerShell - Simple Test-Connection from text list

  • Writer: Jon Boyette
    Jon Boyette
  • Jan 7, 2022
  • 1 min read

ForEach ($COMPUTER in (gc c:\temp\yourfile.txt))

{if(!(Test-Connection -Cn $computer -BufferSize 16 -Count 1 -ea 0 -quiet))

{write-host "Cannot Reach $computer" -f Cyan}

else {

Test-Connection -ComputerName $computer -Count 1

}

}


Save that as a ps1, or copy and paste, build a text file with per line machine name.



 
 
 

Recent Posts

See All
PowerShell - List All Domain SPNs

Save as same List_ALL_SPNs.ps1 or similar, this LDap calls the Domain for all Service Principal names and accounts related #Build LDAP...

 
 
 
PowerShell - Start-Monitoring

This is a great script used to Monitor and Email if a server is up or down, once ran, and smtp and from address is set, then run:...

 
 
 

Comments


Post: Blog2 Post
  • Facebook
  • Twitter
  • LinkedIn

©2022 by Boyette Technical Services. Proudly created with Wix.com

bottom of page