Monday, 28 May 2012

Listing Lync Server IP Addresses

Today I had to compile a list of Lync mediation server IP addresses so that we could create firewall rules to allow traffic from the Lync 2010 edge servers and reverse proxies to the internal servers. I found that there was no easy way to do this using the existing admin tools, and it would have been a slow and repetitive manual lookup of each service and hostname.

To create a repeatable way I could get the IP addresses of these servers I came up with this PowerShell one-liner:

This command will get all the Lync 2010 Mediation Servers in the topology, expand the computer names from each pool, use a .Net call to get the IPv4 IP address, then output a list of IP addresses and hostnames.

For readbility, the same command can be written across several lines as this: