b) i've a list of SERVERS with telnet service turn on.
c) i've only one exchange relay server, let's call it relay_server. Telnet
service is turn on too.
Objective
1. I wish to check whether the list of SERVERS can telnet to relay_server
port 25 (telnet relay_server 25).
What is the best way to do this ? telnet may reply with multiple msg if
successful and if not successful, what msg should i capture ?
can you use v2 remoting together with following?
http://www.leeholmes.com/blog/ReplacingTelnetexeNowRemovedFromVista.aspx
Martin
"IT Staff" <jkk...@hotmail.com> wrote in message
news:#LG7Ukab...@TK2MSFTNGP02.phx.gbl...
function Test-Port{
Param([string]$srv,$port=5001,$timeout=1000,[switch]$verbose)
$ErrorActionPreference = "SilentlyContinue"
$tcpclient = new-Object system.Net.Sockets.TcpClient
$iar = $tcpclient.BeginConnect($srv,$port,$null,$null)
$wait = $iar.AsyncWaitHandle.WaitOne($timeout,$false)
if(!$wait)
{
$tcpclient.Close()
if($verbose){Write-Host "Connection Timeout"}
Return $false
}
else
{
$error.Clear()
$tcpclient.EndConnect($iar) | out-Null
if($error[0]){if($verbose){write-host $error[0]};$failed = $true}
$tcpclient.Close()
}
if($failed){return $false}else{return $true}
}
"IT Staff" wrote:
> .
>