Check test connectivity on remote servers with given IP range-Powershell Script
<#
Script to Test connection of first 10 remote computers within specific IP range (Depends on your environment)
Data Required: First 3 octet IP range, can be done with 2 octet as well.
Name : Richa Sharma #>
# Creating variable dir, IP range: 192.168.1
foreach($temp in $dir)
{
$check=Test-Connection -Quiet $temp
Else
Data Required: First 3 octet IP range, can be done with 2 octet as well.
Name : Richa Sharma #>
# Creating variable dir, IP range: 192.168.1
$dir=1..10 | ForEach-Object {"192.168.1.$_"}
{
$check=Test-Connection -Quiet $temp
if($check -eq $true)
{
Write-Output "$temp is
pinging"
}
{
Write-Output "$temp is not
pinging"
}
}
Comments
Post a Comment