Wednesday, May 1, 2024
HomePowershellTips on how to ping a number of Computer systems directly –...

Tips on how to ping a number of Computer systems directly – SID-500.COM


PowerShell

You need to ping a number of computer systems directly? Can’t? Sure you’ll be able to, with PowerShell. On this put up I’ll present you just a few examples of how one can ping a number of computer systems. We are going to use the Check-Connection cmdlet for this job. It’s going to be thrilling. Let’s get began.

Open PowerShell 5.1 or PowerShell 7.

Instance 1: Ping a number of Computer systems

Check-Connection -ComputerName sid-500.com,192.168.0.1,microsoft.com -Depend 1

Instance 2: Ping all Area-Computer systems

 Check-Connection -ComputerName (Get-ADComputer -Filter * | Choose-Object -ExpandProperty Identify) -Depend 1

Instance 3: Ping Computer systems from Textual content File

Check-Connection -ComputerName (Get-Content material C:DataComputers.txt) -Depend 1

Instance 4: Subnet Ping

Observe that this can solely work in PowerShell 7 due to the -Parallel Parameter.

# PowerShell 7
$subnet="192.168.0."
$ips = 1..254
$ips | ForEach-Object -Parallel {
    Check-Connection -ComputerName $utilizing:subnet$_ -Depend 1 
}

Printed by Patrick Gruenauer

Microsoft MVP on PowerShell [2018-2023], IT-Coach, IT-Guide, MCSE: Cloud Platform and Infrastructure, Cisco Licensed Academy Teacher.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments