Solved

SMTP Connection/Relay List

Posted on 2014-07-28
12
1,456 Views
Last Modified: 2014-07-29
Greetings,

How to export the smtp Connection/Relay list on win server 2008 R2?
Thanks.
0
Comment
Question by:mrong
  • 7
  • 5
12 Comments
 
LVL 5

Expert Comment

by:amac81
ID: 40224899
0
 

Author Comment

by:mrong
ID: 40225012
Please provide step-by-step instructions other than a link.
Thanks.
0
 
LVL 5

Expert Comment

by:amac81
ID: 40225059
Seriously?

Get-ReceiveConnector “name of your connector here”| select -ExpandProperty remoteipranges|export-csv c:\RelayIPs.csv
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:mrong
ID: 40225108
Yes, I never ran command on powershell.

So just type the commands you provided in windows PowerShell blue window like the followings?
What should I replace with “name of your connector here"?

PS C:\> Get-ReceiveConnector “name of your connector here”| select -ExpandProperty remoteipranges|export-csv c:\RelayIPs.csv

Thanks.
0
 
LVL 5

Expert Comment

by:amac81
ID: 40225127
What version of Exchange?

You need to type in the name of the connector that you want to enumerate.
0
 

Author Comment

by:mrong
ID: 40225134
Attached is what I goterror
0
 

Author Comment

by:mrong
ID: 40225135
I don't have exchange server. only using IIS 6.0 for mail relay. thx
0
 
LVL 5

Expert Comment

by:amac81
ID: 40225139
What version of Exchange?  Also are you running this from the Exchange shell?
0
 

Author Comment

by:mrong
ID: 40225147
I ran it from PowerShell. How to check the version of Exchange?
0
 

Author Comment

by:mrong
ID: 40225168
I don't think I have exchange server setup.
0
 
LVL 5

Accepted Solution

by:
amac81 earned 500 total points
ID: 40225207
Gotcha, I didn't see that there was no Exchange.  I just assumed based on the initial post.  My apologies.

I found the below here:  http://www.classictriple.com/iis-export-iis-smtp-relayiplist/

Look at the comments as there are some things you have to change in the code to make it work in your environment.


'#####================================================================================ 
'## Title: ExportRelayIP.vbs
'##     
'## Purpose: 
'##     1. Exports List of IIS 6 SMTP Relay Restriction IP Addresses.
'## References: 
'##     1. http://msdn.microsoft.com/en-us/library/ms525725.aspx, http://msdn.microsoft.com/en-us/library/ms525320.aspx
'##     2. http://msdn.microsoft.com/en-us/library/ms524304.aspx, http://msdn.microsoft.com/en-us/library/ms525808(v=vs.90).aspx
'##     3. http://blogs.msdn.com/b/vijaysk/archive/2009/05/07/setting-smtp-relayiplist-from-a-script.aspx
'#  
'#####================================================================================
 
Set objSMTP = GetObject("IIS://localhost/smtpsvc/1") 'Connect to the IIS Namespace, You can change the "smtpsvc/1" to fit your needs.
Set objRelayIpList = objSMTP.Get("RelayIpList") 'Get the RelayIPListObject
 
' GrantByDefault returns 0 when "only the list below" is set (false) and -1 when all except the list below is set(true)
Wscript.echo "Results will be display based on the Relay Restrictions Radio Buttion Selection"
Wscript.echo "  o Only the list below"
Wscript.echo "  o All Except the list below"
Wscript.echo "-------------"
If objRelayIpList.GrantByDefault = true Then
    Wscript.Echo "All except the list below :"
    Wscript.echo "-------------"
    objCurrentList = objRelayIpList.IPDeny
Else
    Wscript.Echo "Only the list below :"
    Wscript.echo "-------------"
    objCurrentList = objRelayIpList.IPGrant
End If
    count = 0
For Each objIP in objCurrentList
    Wscript.Echo objIP
    count = count + 1
Next
If count = 0 Then
    Wscript.Echo "There were no IP Addresses Found"
End If

Open in new window


Just pipe this to a CSV.
0
 

Author Comment

by:mrong
ID: 40226375
How to pipe this to a CSV file? thx
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups th…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question