Solved

SMTP Connection/Relay List

Posted on 2014-07-28
12
1,231 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
 

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
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…

705 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now