<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[gOxiA=苏繁=SuFan Blog]]></title> 
<link>https://maytide.net/index.php</link> 
<description><![CDATA[gOxiA,苏繁,sufan,Microsoft MVP]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[gOxiA=苏繁=SuFan Blog]]></copyright>
<item>
<link>https://maytide.net/read.php/871.htm</link>
<title><![CDATA[创建邮件交换器 (MX) DNS 记录]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:58:56 +0000</pubDate> 
<guid>https://maytide.net/read.php/871.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong></p></div><div><p>在 DNS 服务器上创建邮件交换器 (MX) DNS 记录。</p></div><div><p>有关在这段代码中使用的 CreateInstanceFromPropertyData 方法的更多信息，请单击<a href="http://msdn.microsoft.com/library/en-us/dns/dns/microsoftdns_mxtype_createinstancefrompropertydata.asp"><span style="color: #666666">此处</span></a>。</p></div><div><p><strong><br />支持平台</strong></p></div><table border="0" cellspacing="0" cellpadding="0" class="dataTable" id="EFAA"><thead></thead><tbody><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows Server 2003</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows XP</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>否（然而，可以在 Windows XP 计算机上对远程 DNS 服务器运行脚本）</strong></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows 2000</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是，需要安装 DNS WMI 提供程序</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows NT 4.0</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>否</strong></p></td></tr></tbody></table><div><p></p><p><br /><strong>脚本代码<br /></strong>strDNSServer = &quot;atl-dc-03.fabrikam.com&quot;<br />strContainer = &quot;fabrikam.com&quot;<br />strOwner = &quot;atl-srv-01.fabrikam.com&quot;<br />intRecordClass = 1<br />intTTL = 600<br />intPreference = 0<br />strMailExchanger = &quot;mailexchanger.fabrikam.com&quot;<br />strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&#92;&#92;&quot; &amp; strComputer &amp; &quot;&#92;root&#92;MicrosoftDNS&quot;)<br />Set objItem = objWMIService.Get(&quot;MicrosoftDNS_MXType&quot;)<br />errResult = objItem.CreateInstanceFromPropertyData _<br />&nbsp; &nbsp;(strDNSServer, strContainer, strOwner, intRecordClass, intTTL, intPreference, strMailExchanger)</p></div></span>
]]>
</description>
</item>
</channel>
</rss>