<?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/870.htm</link>
<title><![CDATA[创建主要 DNS 区域]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:57:24 +0000</pubDate> 
<guid>https://maytide.net/read.php/870.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong></p></div><div><p>在 DNS 服务器上创建名为 accounting.fabrikam.com 的主要 DNS 区域。</p></div><div><p>有关在这段代码中使用的 CreateZone 方法的更多信息，请单击<a href="http://msdn.microsoft.com/library/en-us/dns/dns/microsoftdns_zone_createzone.asp">此处</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>strZoneName = &quot;accounting.fabrikam.com&quot;<br />intPrimaryZone = 1<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_Zone&quot;)<br />errResult = objItem.CreateZone(strZoneName, intPrimaryZone)</p></div></span>
]]>
</description>
</item>
</channel>
</rss>