How to export IIS SMTP replay allow list?

G

graceyin39

Hi,

We use IIS on Windows 2012 R2 server to do email relay. We have a large number of servers to be allowed to use the IIS server to relay email. Not sure what happened, just of sudden all servers were gone in the allow list and we have to add them back one by one. It is time consuming.

I did some research and found a powershell script which can export the server list. This command is below.

Get-WmiObject -Namespace "root\MicrosoftIISv2" -Class "IIsIPSecuritySetting" -Property Name,IPGrant | `
where {$_.Name -eq "SmtpSvc/1"} | `

Select-Object Name,IPGrant | `
foreach {$_.IPGrant} | Out-File "C:\Documents and Settings\stephen.bishop.oa\Desktop\Exporting SMTP Relay IP Addresses.csv"


but I got error like below.

1370103.jpg

I googled around and found that I may have been missing the "IIS Management Scripts and Tools" role service, but I still got the same error after I have installed it.

I need help how to fix the error or how to export/import the SMTP relay allow list in case they are gone again.

Any help will be appreciated!

Thanks in advance!





Grace

Continue reading...
 
Back
Top Bottom