Skip to content

SRM Guru Powershell Script for DNS lookup on SRM/VR/VC Appliances and Port Check for 443!

Below is the powershell script to run from jump box.

$root = “admin” 
$rootvc = “root”
$Passwd = “VMware123!”
$srmPrd = “srm1.gsslabs.org”
$vrPrd = “vr1.gsslabs.org” 
$vcPrd = “vc1.gsslabs.org” 
$srmDr = “srm2.gsslabs.org”
$vrDr = “vr2.gsslabs.org” 
$vcDr = “vc2.gsslabs.org”
$vcAll = $vcPrd, $vcDr
$addOnList = $vrPrd,$vrDr
$listAll = $srmPrd,$vrPrd,$vcPrd,$vrDr
$plink = “echo y |plink.exe”
$cmd = foreach ($node in $listAll) {“echo $node; curl -kv -noproxy ‘https://’$node’:443′; nslookup $node;”}
$remoteCommand = ‘”‘ + $cmd + ‘”‘

foreach ($node in $addOnList) {
$output = $plink + ” ” + “-ssh” + ” ” + $root + “@” + $node + ” ” + “-pw” + ” ” + $Passwd + ” ” + $remoteCommand

}
$message = Invoke-Expression -command $output
$message 

foreach ($node in $vcAll) {
$output = $plink + ” ” + “-ssh” + ” ” + $rootvc + “@” + $node + ” ” + “-pw” + ” ” + $Passwd + ” ” + $remoteCommand

}
$message = Invoke-Expression -command $output
$message 

Output should look like this.

Copy output to notepad++ to tell which node is down or has a firewall issue.

Categories

Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: