Powershell导出Windows 2008 R2 SMTP中继限制IP

我一直在search所有的interwebs,迄今没有运气。 有谁知道是否可以使用Powershell在SMTP中继限制部分中导出IP地址列表? 我们有一个简单的Windows 2008 R2 SMTP服务器,用于内部中继,并有一个我们需要导出的IP地址授权列表。

这看起来应该值得一试。 它抓取WMI名称空间中的列表并对其进行格式化。

################################################################################################################# # # # Name: Exporting SMTP Relay IP Addresses (only) # # Purpose: Exporting the allowed SMTP Relay IP Addresses for backup purposes as well as troubleshooting # # Output: CSV file # # Developed by: Stephen Bishop # # Date: 6/7/2012 # ################################################################################################################# #Note has to be ran on the SMTP Relay# 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" 

信贷去原来的作者。 在这里find:

http://community.idera.com/powershell/script_library/m/iis/17033