Checking Exchange 2010 for Open Relay Configuration

There is plenty of information on the web that instructs us how to configure Exchange 2010 (or 2007) to allow for relay of SMTP to external recipients (Open Relay). For example, Microsoft has posted these instructions.

However, I couldn’t easily find any information about how to check if this was already configured. This could be handy in verifying that a recent configuration was successful or with troubleshooting an open relay issue. The following PowerShell command checks all Receive Connectors on all Exchange servers (2007 & 2010) and returns any Receive Connectors that have been granted the ability to relay to external recipients.

Get-ReceiveConnector | get-ADPermission -User "NT AUTHORITY\ANONYMOUS LOGON" | Where {$_.ExtendedRights -like "Ms-Exch-SMTP-Accept-Any-Recipient"}
Posted in Exchange 2007, Exchange 2010, PowerShell

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>