Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to use powershell to find all available mail servers in a given network segment, or domain wide. Is this possible and how could you do it?

share|improve this question
up vote 4 down vote accepted

Do you mean something like this?

Get-ExchangeServer -domain [DOMAIN NAME]

share|improve this answer

get-mailboxserver from the Exchange powershell is supposed to be able to do this.

Name                      ManagedFolderAssi ClusteredStorageT MapiEncryptionReq
                          stantSchedule     ype               uired
----                      ----------------- ----------------- -----------------
EXCHMAILBOX3                                Disabled          False
EXCHMAILBOX4                                Disabled          False
EXCHMAILBOX1                                Disabled          False
EXCHMAILBOX2                                Disabled          False

Is there some part of your environment that makes this not work for you?

share|improve this answer
I'd do Get-Exchangeserver - that should do all roles, not just mailbox servers. – Ben Pilbrow Aug 27 '10 at 20:45

If they're exchange, you can probably use Powershell to query AD for that, sure. If they're not exchange, it depends on how you define "mailserver", and regardless, that will be much more difficult.

  • Good answer below for Exchange, exactly what I figured there would be.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.