Tuesday, July 4, 2017

Using PowerShell To Retrieve IP Addresses for Exchange Servers

Hi Folks,

In this short post I will share with you a command on how to retrieve list of IP addresses for your Exchange servers. As you will see below it's very straightforward. It simply pipes all hostnames and then resolves each of them from DNS:

Get-ExchangeServer  |foreach {Resolve-DnsName $_.Name -NoHostsFile -Type A} |select Name,IPAddress

You will get a nice output like below:



Alternatively you can use Export-Csv command to export your results to CSV file if you need any further processing or reporting of this data.

Enjoy!