Eu percebi isso (este é um deles, mas pode ser facilmente reinserido para backup) Este é um script do PowerShell
#param([String] $remoteHost =$(throw "Please specify the Target Server"),[String] $domain = $(throw "Please specify the #recipient Domain"),[String] $sendingdomain = $(throw "Please specify the Sending Domain"))
param([String] $remoteHost,[String] $domain, [String] $sendingdomain)
$remotehosts ="List","Of","Cisco","IPs"
$theUn = "UserName"
$thePw = "Password"
function readResponse {
while($stream.DataAvailable)
{
$read = $stream.Read($buffer, 0, 1024)
write-host -n -foregroundcolor cyan ($encoding.GetString($buffer, 0, $read))
""
}
}
$port = 23
foreach($remoteHost in $remoteHosts)
{
$socket = new-object System.Net.Sockets.TcpClient($remoteHost, $port)
if($socket -eq $null) { return; }
$stream = $socket.GetStream()
$writer = new-object System.IO.StreamWriter($stream)
$buffer = new-object System.Byte[] 1024
$encoding = new-object System.Text.AsciiEncoding
$command = $theUn
$writer.WriteLine($command)
$writer.Flush()
start-sleep -m 3000
readResponse($stream)
write-host -foregroundcolor DarkGreen $command
""
$command = $thePw
$writer.WriteLine($command)
$writer.Flush()
start-sleep -m 2000
readResponse($stream)
write-host -foregroundcolor DarkGreen $command
""
$command = "en"
$writer.WriteLine($command)
$writer.Flush()
start-sleep -m 2000
readResponse($stream)=
write-host -foregroundcolor DarkGreen $command
""
$command = $thePw
$writer.WriteLine($command)
$writer.Flush()
start-sleep -m 2000
readResponse($stream)
write-host -foregroundcolor DarkGreen $command
""
$command = "wr"
$writer.WriteLine($command)
$writer.Flush()
start-sleep -m 5000
readResponse($stream)
write-host -foregroundcolor DarkGreen $command
""
$command = ""
$writer.WriteLine($command)
$writer.Flush()
start-sleep -m 2000
readResponse($stream)
write-host -foregroundcolor DarkGreen $command
""
$command = "reload"
$writer.WriteLine($command)
$writer.Flush()
start-sleep -m 2000
readResponse($stream)
write-host -foregroundcolor DarkGreen $command
""
$command = ""
$writer.WriteLine($command)
$writer.Flush()
start-sleep -m 2000
readResponse($stream)
write-host -foregroundcolor DarkGreen $command
""
$writer.Flush()
readResponse($stream)
## Close the streams
$writer.Close()
start-sleep -m 120000
}
Eu duvido que seja perfeito, mas funciona desafiadoramente.