Solved

SMTP Connection/Relay List

Posted on 2014-07-28
12
1,669 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

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...
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

688 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