Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

How to Test-Connection against 2 static FQDN and store 'Online' response in Variable

$
0
0

Being new to the world of PS, I am certain there is an easy way to accomplish this.. I just haven't found it yet.  I'm in the process of learning the PS processes, but if there is anyone that could help me with this, I would be very appreciative!!

I need to do the following:  I have 2 static FQDN addresses (i.e. server.here.com and server2.here.com) that I need to test-connection or ping, and if the server responds, I need to store the server name in a variable that can be used by another script/process.  We have multiple email services that provide outbound SMTP and I need to be able to change between them, but really only in the event that the primary address is unresponsive.  The process that sends the outbound messages does not have the option to multi-select SMTP sources, so we need to verify uptime between 2 static addresses and store the one that responds in a variable.

Is this something that would be easy to achieve?

Thank you in advance for your help!!


Viewing all articles
Browse latest Browse all 6937

Trending Articles