?
Solved

SMTP Connection/Relay List

Posted on 2014-07-28
12
Medium Priority
?
1,846 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 

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 2000 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
Suggested Courses

762 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