<?xml version="1.0" encoding="UTF-8"?>
  <feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html"><![CDATA[刘辉的博客]]></title>
  <subtitle type="html"><![CDATA[服务器设置，网络安全，所有和it有关的技术我都贡献出来和大家分享.......]]></subtitle>
  <id>http://www.anywolfs.com/liuhui/</id>
  <link rel="alternate" type="text/html" href="http://www.anywolfs.com/liuhui/" /> 
  <link rel="self" type="application/atom+xml" href="http://www.anywolfs.com/liuhui/atom.asp" /> 
  <generator uri="http://www.pjhome.net/" version="2.8">PJBlog3</generator> 
  <updated>2009-06-24T10:38:40+08:00</updated>

  <entry>
	  <title type="html"><![CDATA[WebQQ beta 1.6.12 使用感觉]]></title>
	  <author>
		 <name>jothui</name>
		 <uri>http://www.anywolfs.com/liuhui/</uri>
		 <email>jothui8@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://www.anywolfs.com/liuhui/default.asp?cateID=8" label="My Log" /> 
	  <updated>2009-06-24T10:38:40+08:00</updated>
	  <published>2009-06-24T10:38:40+08:00</published>
		  <summary type="html"><![CDATA[有时候被迫无奈,需要在网吧使用msn,然网吧的机器上一般很鄙视msn的存在,他们从来都不安装这个叫着msn的东西,所以没办法只好使用webmsn,webmsn的设计想法很好,类似于bbs私聊一样,通过web进行一一信息传递,.但微软的msn开发团队实在是太偷懒了,他们不愿意给webmsn进行一些娱乐的人性化的界面或工具开发,当然就算msn本身这方面也很缺乏.<br/><br/>唠叨半天,我要说的其实是webqq,试用了两天,感觉还比较爽,界面清新简洁，没有最让我反感的广告图片，不会无聊的弹出什么新闻窗口，整体页面还蛮让我满意。<br/><img src="http://www.anywolfs.com/liuhui/attachments/month_0906/c2009624102954.jpg" border="0" alt=""/><br/>打开第一个界面就是好友近况，有好友的qzone更新，好友栏我觉得比qq本身做的还漂亮，信息简单，没有那么多乱七八糟的签名啊等等<br/><img src="http://www.anywolfs.com/liuhui/attachments/month_0906/o2009624103252.jpg" border="0" alt=""/><br/>聊天窗口设计的有点死板，不够人性化和娱乐化，，<br/><br/><img src="http://www.anywolfs.com/liuhui/attachments/month_0906/w2009624103341.jpg" border="0" alt=""/><br/><br/>信息盒子做的也不错，没有任何广告图片，，闪的我眼花<br/><br/><img src="http://www.anywolfs.com/liuhui/attachments/month_0906/c2009624103431.jpg" border="0" alt=""/><br/><br/>在别人网站上down了一个说明比较详细的图片:<br/><br/><img src="http://www.anywolfs.com/liuhui/attachments/month_0906/n2009624103535.jpg" border="0" alt=""/><br/><br/>目前webqq更新这些功能：<br/>1.天气预报：鼠标移上即可看到所在地的天气预报<br/>2.邮件功能优化：增加了写新邮件、刷新收件箱的链接<br/>3.支持QQ传统<a href="http://www.anywolfs.com/liuhui/article.asp?id=64" target="_blank">快捷键</a>：alt+c关闭当前聊天窗口、alt+s发送消息<br/>4.好友在线状态优化：底部状态栏的好友大头像即可直观显示好友是否在线了<br/>5.应大家的要求新增了QQ校友的快捷链接，并可使用网页浏览栏目直接使用<br/>6.会员红名：与QQ软件一样，已经是会员的好友昵称显示为红色<br/>7.修复了在非IE浏览器下无法修改个性签名的bug<br/><br/><br/>当然我最大的希望就是腾讯的webqq退队别像webmsn一样懒惰，还有别加入那些让人难受的广告，继续完善这个工具，最好能做的和qq软件本身一样人性化。<br/><br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.anywolfs.com/liuhui/article.asp?id=425" /> 
	  <id>http://www.anywolfs.com/liuhui/default.asp?id=425</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[windows2008 安全设置－文件安全前提篇(takeown.exe )]]></title>
	  <author>
		 <name>jothui</name>
		 <uri>http://www.anywolfs.com/liuhui/</uri>
		 <email>jothui8@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://www.anywolfs.com/liuhui/default.asp?cateID=4" label="Security" /> 
	  <updated>2009-06-17T14:03:46+08:00</updated>
	  <published>2009-06-17T14:03:46+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;玩过<a href="http://www.anywolfs.com/liuhui/search.asp?SearchContent=windows&amp;searchType=Content" target="_blank">windows</a>2008的朋友都知道，<a href="http://www.anywolfs.com/liuhui/search.asp?SearchContent=windows&amp;searchType=Content" target="_blank">windows</a>2008系统文件的安全更改和<a href="http://www.anywolfs.com/liuhui/search.asp?SearchContent=windows&amp;searchType=Content" target="_blank">windows</a>2003以及<a href="http://www.anywolfs.com/liuhui/search.asp?SearchContent=windows&amp;searchType=Content" target="_blank">windows</a>2000已经不一样了，原来的系统我们相对一个文件或文件夹进行安全配置，只需要在安全属性里面把需要的添加，不需要的删除，即可完成安全操作。但是在<a href="http://www.anywolfs.com/liuhui/search.asp?SearchContent=windows&amp;searchType=Content" target="_blank">windows</a>2008下，当你使用这个方法的时候碰到困难了，因为我们没有权限去配置安全，比如我们以sysytem32下的find.exe文件的安全配置作为例子，当我们右键－属性－安全－编辑，发现所有配置都是灰色：<br/><img src="http://www.anywolfs.com/liuhui/attachments/month_0906/d2009617133725.JPG" border="0" alt=""/><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;在安全里面－高级－编辑，新窗口中发现只有一个查看按钮可以点击，原来传统的编辑按钮不存在了：<br/><br/><img src="http://www.anywolfs.com/liuhui/attachments/month_0906/k2009617133937.JPG" border="0" alt=""/><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;点击查看按钮，发现里面的所有配置也都是灰色，无法做任何修改。当我们使用以往的<a href="http://www.anywolfs.com/liuhui/search.asp?SearchContent=%E5%91%BD%E4%BB%A4%E8%A1%8C&amp;searchType=title" target="_blank">命令行</a>cacls.exe文件来配置其他文件的权限时候，提示“<strong>拒绝访问。</strong>”，也就是说，我们以管理员的身份也无法对系统文件的安全进行任何的修改。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;经过我反复研究，发现真正造成这个问题的原因是文件的所有者，在<a href="http://www.anywolfs.com/liuhui/search.asp?SearchContent=windows&amp;searchType=Content" target="_blank">windows</a>2008系统中，我们安装完系统以后，系统所有文件和文件夹的所有者默认都是“TrustedInstaller”：<br/><img src="http://www.anywolfs.com/liuhui/attachments/month_0906/q2009617134755.JPG" border="0" alt=""/><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 我们在计算机管理里面用户管理界面上找不到这个用户，具体这个用户的属性我没有查找官方的相关说明， 不知道他对我们的安全具体起到什么作用。<br/>&nbsp;&nbsp;&nbsp;&nbsp;我们只需要将文件的所有者“TrustedInstaller”修改成“administrators”，那么我们对文件权限的操作就会随心所欲，我们在所有者窗口上，选择administrators，点击应用：<br/><img src="http://www.anywolfs.com/liuhui/attachments/month_0906/s2009617135219.JPG" border="0" alt=""/><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;这样就会修改文件的所有者为“administrators”：<br/><img src="http://www.anywolfs.com/liuhui/attachments/month_0906/x2009617135331.JPG" border="0" alt=""/><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;现在我们对文件权限可以进行任何预期的编辑了，以前是灰色无法编辑的部分都已经可以进行修改：<br/><br/><img src="http://www.anywolfs.com/liuhui/attachments/month_0906/12009617135437.JPG" border="0" alt=""/><br/><br/><img src="http://www.anywolfs.com/liuhui/attachments/month_0906/n2009617135448.JPG" border="0" alt=""/><br/><br/>具体权限的修改方法我这里就不做任何说明，和原来<a href="http://www.anywolfs.com/liuhui/search.asp?SearchContent=windows&amp;searchType=Content" target="_blank">windows</a>2003上是相同的。<br/><br/>下面我们通过<a href="http://www.anywolfs.com/liuhui/search.asp?SearchContent=%E5%91%BD%E4%BB%A4%E8%A1%8C&amp;searchType=title" target="_blank">命令行</a>实现所有这的修改，这样可以不需要你去点击，我来先介绍一个工具：<strong>takeown.exe</strong><br/><br/>该工具的使用说明如下：<br/><br/><div class="UBBPanel quotePanel"><div class="UBBTitle"><img src="http://www.anywolfs.com/liuhui/images/quote.gif" style="margin:0px 2px -3px 0px" alt="引用内容"/> 引用内容</div><div class="UBBContent"><br/><br/>TAKEOWN [/S system [/U username [/P [password]]]]<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/F filename [/A] [/R [/D prompt]]<br/><br/>描述:<br/>&nbsp;&nbsp;&nbsp;&nbsp;该工具以重新分配文件所有权的方式允许管理员重新获取先前被拒绝访问<br/>&nbsp;&nbsp;&nbsp;&nbsp;的文件访问权。<br/><br/>参数列表:<br/>&nbsp;&nbsp;&nbsp;&nbsp;/S&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; system&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;指定要连接到的远程系统。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;/U&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [domain\]user&nbsp;&nbsp; 指定用户上下文，命令在此上下文中执行。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;/P&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [password]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;指定给定用户上下文的密码。如果省略，<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 提示输入。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;/F&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filename&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;指定文件名或目录名模式。可以用通配符 &#34;*&#34;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 指定模式。允许共享名\文件名。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;/A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 将所有权给于管理员组，而不是当前用户。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;/R&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 递归: 指示工具运行于指定的目录和子目录<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 里的文件上。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;/D&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; prompt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当前用户在一个目录里没有“列出文件夹”<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 权限时，使用默认答案。当在子目录里进行<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 递归 (/R) 操作时会发生这种情况。用有效<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 值 &#34;Y&#34; 获取所有权或用 &#34;N&#34; 跳过。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;/?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 显示该帮助消息。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;注意: 1) 如果指定了 /A，文件所有权会给与当前登录的用户。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2) 不支持用 &#34;?&#34; 和 &#34;*&#34; 混合的模式。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3) /D 用于抑制确认提示。<br/><br/>示例:<br/>&nbsp;&nbsp;&nbsp;&nbsp;TAKEOWN /?<br/>&nbsp;&nbsp;&nbsp;&nbsp;TAKEOWN /F lostfile<br/>&nbsp;&nbsp;&nbsp;&nbsp;TAKEOWN /F \\system\share\lostfile /A<br/>&nbsp;&nbsp;&nbsp;&nbsp;TAKEOWN /F directory /R /D N<br/>&nbsp;&nbsp;&nbsp;&nbsp;TAKEOWN /F directory /R /A<br/>&nbsp;&nbsp;&nbsp;&nbsp;TAKEOWN /F *<br/>&nbsp;&nbsp;&nbsp;&nbsp;TAKEOWN /F C:\Windows\System32\acme.exe<br/>&nbsp;&nbsp;&nbsp;&nbsp;TAKEOWN /F %windir%\*.txt<br/>&nbsp;&nbsp;&nbsp;&nbsp;TAKEOWN /S system /F MyShare\Acme*.doc<br/>&nbsp;&nbsp;&nbsp;&nbsp;TAKEOWN /S system /U user /F MyShare\foo.dll<br/>&nbsp;&nbsp;&nbsp;&nbsp;TAKEOWN /S system /U domain\user /P password /F share\filename<br/>&nbsp;&nbsp;&nbsp;&nbsp;TAKEOWN /S system /U user /P password /F Doc\Report.doc /A<br/>&nbsp;&nbsp;&nbsp;&nbsp;TAKEOWN /S system /U user /P password /F Myshare\*<br/>&nbsp;&nbsp;&nbsp;&nbsp;TAKEOWN /S system /U user /P password /F Home\Logon /R<br/>&nbsp;&nbsp;&nbsp;&nbsp;TAKEOWN /S system /U user /P password /F Myshare\directory /R /A<br/><br/></div></div><br/><br/>我们需要修改find.exe的所有者只需要输入命令：<i>C:\&gt;c:\Windows\System32\takeown.exe /f c:\Windows\System32\find.exe /a</i>马上会返回成功的提示<br/><strong>成功: 此文件(或文件夹): &#34;c:\Windows\System32\find.exe&#34; 现在由管理员组所有。</strong><br/><br/>之后我们再用cacls.exe对文件进行安全配置，就非常方便了:<br/><i>C:\&gt;cacls c:\<a href="http://www.anywolfs.com/liuhui/search.asp?SearchContent=windows&amp;searchType=Content" target="_blank">windows</a>\system32\find.exe /g administrators:f system:f</i><br/><strong>处理的文件: c:\<a href="http://www.anywolfs.com/liuhui/search.asp?SearchContent=windows&amp;searchType=Content" target="_blank">windows</a>\system32\find.exe</strong><br/><img src="http://www.anywolfs.com/liuhui/attachments/month_0906/8200961714130.JPG" border="0" alt=""/><br/><br/>以后<a href="http://www.anywolfs.com/liuhui/search.asp?SearchContent=windows&amp;searchType=Content" target="_blank">windows</a>2008系统的相关安全配置我会慢慢的补充，这里就说道这里了。。enjoy youself<br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.anywolfs.com/liuhui/article.asp?id=424" /> 
	  <id>http://www.anywolfs.com/liuhui/default.asp?id=424</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[游标不包括正在修改的表，或该表不能通过此游标更新]]></title>
	  <author>
		 <name>jothui</name>
		 <uri>http://www.anywolfs.com/liuhui/</uri>
		 <email>jothui8@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://www.anywolfs.com/liuhui/default.asp?cateID=6" label="Software" /> 
	  <updated>2009-05-27T15:01:49+08:00</updated>
	  <published>2009-05-27T15:01:49+08:00</published>
		  <summary type="html"><![CDATA[<p>错误一：<br />
[<em>Microsoft][ODBC SQL Server Driver][SQL Server]在 sys.servers 中找不到服务器 'anywolfs.com'。请验证指定的服务器名称是否正确。如果需要，请执行存储过程 sp_addlinkedserver 以将服务器添加到 sys.servers。</em></p>
<p>错误二： <br />
<em>[Microsoft][ODBC SQL Server Driver][SQL Server]未将服务器 'anywolfs.com' 配置为用于 DATA ACCESS。</em></p>
<p>错误三：<br />
<em>[Microsoft][ODBC SQL Server Driver][SQL Server]此游标不包括正在修改的表，或该表不能通过此游标更新。</em></p>
<p>&nbsp;在asp中如果我使用rs.add和rs.update来添加数据就会报错误三，如果我使用insert into,就不会发生任何错误。在网上搜索半天，发现解决方法挺好用，方法如下：</p>
<p>解决：</p>
<p>如果是直接更换的服务器，那么主机名更换了，以前存在数据库的主机名也需要删除。进入SQL2005查询器<br />
执行：<br />
<em>&nbsp; <br />
EXEC select @@servername<br />
EXEC sp_dropserver @@servername<br />
EXEC sp_addserver [new_name], local</em></p>
<p>第一行是查出老的实例名<br />
第二行是删除老的实例名<br />
第三行是 &lsquo;new_name&rsquo; 是新的实例名，也就是当前计算机名，在重启一下sql2005服务，</p>
<p>执行完这一步，这时候如果asp会报错：</p>
<p><em>Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'<br />
[Microsoft][ODBC SQL Server Driver][SQL Server]未将服务器 'anywolfs.com' 配置为用于 DATA ACCESS。</em>&nbsp;<br />
&nbsp;<br />
需要设置模式，执行：<br />
<em>EXEC sp_serveroption 'anywolfs.com', 'data access', 'true' </em></p>
<p>这时如果asp遇到：</p>
<p><em>[Microsoft][ODBC SQL Server Driver][SQL Server]此游标不包括正在修改的表，或该表不能通过此游标更新。</em></p>
<p><br />
则需要再重启sql2005，</p>
<p>重启后还是没有解决问题，那么可以使用sp_helpserver 查看有多少实例名，然后统统都给他删掉（sp_dropserver @@服务器名&nbsp;&nbsp;&nbsp; 来删除所有服务器），在执行 sp_addserver 等其他操作。或者重新运行一下上面的命令，重新做一遍，重启sql2005解决不了问题可以重启服务器看看。</p>
<p>我的就是重启服务器就解决</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.anywolfs.com/liuhui/article.asp?id=423" /> 
	  <id>http://www.anywolfs.com/liuhui/default.asp?id=423</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[命令行 重命令administrator]]></title>
	  <author>
		 <name>jothui</name>
		 <uri>http://www.anywolfs.com/liuhui/</uri>
		 <email>jothui8@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://www.anywolfs.com/liuhui/default.asp?cateID=3" label="Systems" /> 
	  <updated>2009-05-21T11:20:17+08:00</updated>
	  <published>2009-05-21T11:20:17+08:00</published>
		  <summary type="html"><![CDATA[在百度上搜索半天终于被我找到了修改的方法，测试发现很爽，修改没问题，方法也很简单，如下：<br/><br/><strong>wmic useraccount wh&#101;re name=&#39;Administrator&#39; call Rename anywolfs.com</strong><br/><br/>如果有兴趣的朋友可以去看看wmic的具体使用方法，参考：<br/><a href="http://technet.microsoft.com/zh-cn/library/cc779482" target="_blank" rel="external">http://technet.microsoft.com/zh-cn/library/cc779482</a>(WS.10).aspx]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.anywolfs.com/liuhui/article.asp?id=422" /> 
	  <id>http://www.anywolfs.com/liuhui/default.asp?id=422</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[如何配置 URLScan 工具]]></title>
	  <author>
		 <name>jothui</name>
		 <uri>http://www.anywolfs.com/liuhui/</uri>
		 <email>jothui8@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://www.anywolfs.com/liuhui/default.asp?cateID=6" label="Software" /> 
	  <updated>2009-05-21T11:08:17+08:00</updated>
	  <published>2009-05-21T11:08:17+08:00</published>
		  <summary type="html"><![CDATA[<h3 id="tocHeadRef">安装 URLScan</h3>
<p><script type="text/javascript">
                loadTOCNode(2, 'summary');
            </script>要安装 URLScan，请访问下面的 Microsoft Developer Network (MSDN) 网站：</p>
<div class="indent"><a href="http://msdn2.microsoft.com/en-us/library/aa302368.aspx">http://msdn2.microsoft.com/en-us/library/aa302368.aspx</a><span class="pLink"> </span></div>
<p>有关其他信息，请单击下面的文章编号，以查看 Microsoft 知识库中相应的文章：</p>
<div class="indent"><a class="KBlink" href="http://support.microsoft.com/kb/307608/">307608</a>&nbsp; <span class="pLink">(http://support.microsoft.com/kb/307608/ ) </span>对 IIS 使用 URLScan</div>
<h3 id="tocHeadRef">修改 URLScan.ini 文件</h3>
<p><script type="text/javascript">
                loadTOCNode(2, 'summary');
            </script>URLScan 的所有配置都是通过 URLScan.ini 文件执行的，此文件位于 %WINDIR%\System32\Inetsrv\URLscan 文件夹中。要配置 URLScan，请在文本编辑器（如记事本）中打开此文件，进行相应的更改，然后保存此文件。<br />
<br />
<b>注意</b>：要使更改生效，必须重新启动 Internet 信息服务 (IIS)。一种快速的实现方法是在命令提示符处运行 <b>IISRESET</b>。 <br />
<br />
URLScan.ini 文件包含以下几节：</p>
<ul>
    <li><b>[Options]</b>：此节描述常规 URLScan 选项。</li>
    <li><b>[AllowVerbs] 和 [DenyVerbs]</b>：此节定义 URLScan 允许的谓词（又称作 HTTP 方法）。</li>
    <li><b>[DenyHeaders]</b>：此节列出 HTTP 请求中不允许的 HTTP 标头。如果 HTTP 请求中包含此节中列出的 HTTP 标头之一，URLScan 将拒绝该请求。</li>
    <li><b>[AllowExtensions] 和 [DenyExtensions]</b>：此节定义 URLScan 允许的文件扩展名。</li>
    <li><b>[DenyURLSequences]</b>：此节列出 HTTP 请求中不允许的字符串。URLScan 拒绝那些包含此节中出现的字符串的 HTTP 请求。</li>
</ul>
<p>本文将更详细地介绍每一节。<br />
<br />
&nbsp;</p>
<h4 id="tocHeadRef">[Options] 节</h4>
<p><script type="text/javascript">
            loadTOCNode(3, 'summary');
        </script>在 <b>[Options]</b> 节中，可以配置许多 URLScan 选项。此节中的每一行都具有以下格式：</p>
<div class="indent"><var>OptionName</var>=<var>OptionValue</var></div>
<p>可用选项及其默认值如下所示：</p>
<ul>
    <li><b>UseAllowVerbs=1</b><br />
    <br />
    默认情况下，此选项设置为 1。如果将此选项设置为 1，则 URLScan 仅允许那些使用 <b>[AllowVerbs]</b> 节中列出的谓词的 HTTP 请求。URLScan 禁止任何不使用这些谓词的请求。如果将此选项设置为 0，则 URLScan 忽略 <b>[AllowVerbs]</b> 节，相反仅禁止那些使用 <b>[DenyVerbs]</b> 节中列出的谓词的请求。</li>
    <li><b>UseAllowExtensions=0</b><br />
    <br />
    默认情况下，此选项设置为 0。如果将此选项设置为 0，则 URLScan 禁止对 <b>[DenyExtensions]</b> 节中列出的文件扩展名的请求，但允许对任何其他文件扩展名的请求。如果将此选项设置为 1，则 URLScan 仅允许对带 <b>[AllowExtensions]</b> 节中列出的扩展名的文件的请求，而禁止对任何其他文件的请求。</li>
    <li><b>NormalizeUrlBeforeScan=1</b><br />
    <br />
    IIS 收到用 URL 编码的请求。这表示某些字符可能被替换为百分号 (%) 后跟特定的数字。例如，%20 对应于一个空格，因此，对 http://myserver/My%20Dir/My%20File.htm 的请求与对 http://myserver/My Dir/My File.htm 的请求是相同的。标准化就是对 URL 编码请求进行解码的过程。默认情况下，此选项设置为 1。如果将 <b>NormalizeUrlBeforeScan</b> 选项设置为 1，则 URLScan 分析已解码的请求。如果将此选项设置为 0，则 URLScan 分析未解码的请求。将此选项设置为 0 会影响 URLScan 禁止某种攻击的能力。</li>
    <li><b>VerifyNormalization=1</b><br />
    <br />
    由于百分号 (%) 本身可以是 URL 编码的，所以攻击者可以向服务器提交一个精心制作的、基本上是双重编码的请求。如果发生这种情况，IIS 可能会接受本应视作无效而拒绝的请求。默认情况下，此选项设置为 1。如果将 <b>VerifyNormalization</b> 选项设置为 1，则 URLScan 将对 URL 执行两次标准化。如果第一次标准化后的 URL 与第二次标准化后的 URL 不同，URLScan 将拒绝该请求。这样就可以防止那些依赖双重编码请求的攻击。</li>
    <li><b>AllowHighBitCharacters=0</b><br />
    <br />
    默认情况下，此选项设置为 0。如果将此选项设置为 0，则 URLScan 拒绝任何包含非 ASCII 字符的请求。这样可以防止某些类型的攻击，但同时可能也会禁止对某些合法文件的请求，如带有非英文名的文件。</li>
    <li><b>AllowDotInPath=0</b><br />
    <br />
    默认情况下，此选项设置为 0。如果将此选项设置为 0，则 URLScan 拒绝所有包含多个句点 (.) 的请求。这样可以防止通过将安全的文件扩展名放入 URL 的路径信息或查询字符串部分，以达到伪装请求中的危险文件扩展名的企图。例如，如果将此选项设置为 1，则 URLScan 可能允许对 http://servername/BadFile.exe/SafeFile.htm 的请求，因为它认为这是对 HTML 页的请求，但实际上这是一个对可执行 (.exe) 文件的请求，而该文件的名称在 PATH_INFO 区域中显示为 HTML 页的名称。如果将此选项设置为 0，URLScan 可能还会拒绝对包含句点的目录的请求。</li>
    <li><b>RemoveServerHeader=0</b><br />
    <br />
    默认情况下，Web 服务器返回一个标头，其中指出了 Web 服务器在所有响应中运行的 Web 服务器软件。这会增加服务器遭受攻击的可能性，因为攻击者可以确定服务器正在运行 IIS，于是便攻击已知的 IIS 问题，而不是试图使用为其他 Web 服务器设计的攻击手段来攻击 IIS 服务器。默认情况下，此选项设置为 0。如果将 <b>RemoveServerHeader</b> 选项设置为 1，可以防止您的服务器发送将其标识为 IIS 服务器的标头。如果将 <b>RemoveServerHeader</b> 设置为 0，则仍发送此标头。</li>
    <li><b>AlternateServerName=（默认情况下不指定）</b><br />
    <br />
    如果将 <b>RemoveServerHeader</b> 设置为 0，可以在 <b>AlternateServerName</b> 选项中指定一个字符串以指定将在服务器标头中传回的内容。如果将 <b>RemoveServerHeader</b> 设置为 1，则此选项将被忽略。</li>
    <li><b>EnableLogging=1</b><br />
    <br />
    默认情况下，URLScan 在 %WINDIR%\System32\Inetsrv\URLScan 中保留所有被禁止的请求的完整日志。如果不希望保留此日志，可将 <b>EnableLogging</b> 设置为 0。</li>
    <li><b>PerProcessLogging=0</b><br />
    <br />
    默认情况下，此选项设置为 0。如果将此选项设置为 1，URLScan 将为承载 URLScan.dll 的每个进程创建一个单独的日志。如果将此选项设置为 0，所有进程将记录到同一个文件中。</li>
    <li><b>PerDayLogging=1</b><br />
    <br />
    默认情况下，此选项设置为 1。如果将该值设置为 1，则 URLScan 每天创建一个新的日志文件。每个日志文件的名称都是 Urlscan.<var>MMDDYY</var>.log，其中 <var>MMDDYY</var> 是日志文件的日期。如果将该值设置为 0，则所有日志记录都保存在同一个文件中，与日期无关。</li>
    <li><b>AllowLateScanning=0</b><br />
    <br />
    默认情况下，此选项设置为 0。如果将此选项设置为 0，则 URLScan 作为高优先级筛选器运行，这表示它先于服务器上安装的所有其他 Internet 服务器应用程序编程接口 (ISAPI) 筛选器执行。如果将此选项设置为 1，则 URLScan 作为低优先级筛选器运行，以便其他筛选器可以在 URLScan 进行任何分析之前修改 URL。FrontPage Server Extensions (FPSE) 要求将此选项设置为 1。</li>
    <li><b>RejectResponseUrl=（默认情况下不指定）</b><br />
    <br />
    此选项指定在 URLScan 禁止请求时运行的文件的虚拟路径。这允许您自定义针对被禁止的请求发送给客户机的响应。必须将 <b>RejectResponseUrl</b> 指定为相应文件的虚拟路径，如 /Path/To/RejectResponseHandler.asp。可以指定 URLScan 通常禁止的文件，如 Active Server Pages (ASP) 页。还可以从该页指定以下服务器变量：
    <ul>
        <li><b>HTTP_URLSCAN_STATUS_HEADER</b>：此变量指定请求被禁止的原因。</li>
        <li><b>HTTP_URLSCAN_ORIGINAL_VERB</b>：此变量指定被禁止的请求中的原始谓词（例如 GET、POST、HEAD 或 DEBUG）。</li>
        <li><b>HTTP_URLSCAN_ORIGINAL_URL</b>：此变量指定被禁止的请求中的原始 URL。</li>
    </ul>
    如果将 <b>RejectResponseUrl</b> 设置为特殊值 <b>/~*</b>，则 URLScan 使用&ldquo;仅日志记录&rdquo;模式。这允许 IIS 为所有请求提供服务，但它会在 URLScan 日志中为所有通常被禁止的请求添加相应的项。这在需要测试 URLScan.ini 文件时很有用。<br />
    <br />
    如果没有指定 <b>RejectResponseUrl</b> 的值，则 URLScan 使用默认值 <b>/&lt;Rejected-By-UrlScan&gt;</b>。<br />
    <br />
    &nbsp;</li>
    <li><b>UseFastPathReject=0</b><br />
    <br />
    默认情况下，此选项设置为 0。如果将此选项设置为 1，则 URLScan 忽略 <b>RejectResponseUrl</b> 设置并立即向浏览器返回 404 错误信息。这比处理 <b>RejectResponseUrl</b> 要快，但它允许的日志记录选项没有那么多。如果将此选项设置为 0，则 URLScan 使用 <b>RejectResponseUrl</b> 设置来处理请求。</li>
</ul>
<h4 id="tocHeadRef">[AllowVerbs] 节和 [DenyVerbs] 节</h4>
<p><script type="text/javascript">
            loadTOCNode(3, 'summary');
        </script><b>[AllowVerbs]</b> 节和 <b>[DenyVerbs]</b> 节定义 URLScan 允许的 HTTP 谓词（又称作方法）。常用的 HTTP 谓词包括 GET、POST、HEAD 和 PUT。其他应用程序（如 FPSE 和 Web 分布式创作和版本控制 (WebDAV)）使用更多的谓词。<br />
<br />
<b>[AllowVerbs]</b> 节和 <b>[DenyVerbs]</b> 节的语法相同。它们由 HTTP 谓词列表组成，每个谓词占一行。<br />
<br />
URLScan 根据 <b>[Options]</b> 节中 <b>UseAllowVerbs</b> 选项的值来决定使用哪一节。默认情况下，此选项设置为 1。如果将 <b>UseAllowVerbs</b> 设置为 1，则 URLScan 仅允许那些使用 <b>[AllowVerbs]</b> 节中列出的谓词的请求。不使用任何这些谓词的请求将被拒绝。在这种情况下，<b>[DenyVerbs]</b> 节被忽略。<br />
<br />
如果将 <b>UseAllowVerbs</b> 设置为 0，则 URLScan 拒绝那些使用 <b>[DenyVerbs]</b> 节中明确列出的谓词的请求。允许任何使用未在此节中出现的谓词的请求。在这种情况下，URLScan 忽略 <b>[AllowVerbs]</b> 节。<br />
<br />
&nbsp;</p>
<h4 id="tocHeadRef">[DenyHeaders] 节</h4>
<p><script type="text/javascript">
            loadTOCNode(3, 'summary');
        </script>当客户机向 Web 服务器请求页面时，它通常会发送一些包含有关此请求的其他信息的 HTTP 标头。常见的 HTTP 标头包括：</p>
<ul>
    <li><b>Host:</b><br />
    <br />
    此标头包含 Web 服务器的名称。</li>
    <li><b>Accept:</b><br />
    <br />
    此标头定义客户机可以处理的文件类型。</li>
    <li><b>User-Agent:</b><br />
    <br />
    此标头包含请求页面的浏览器的名称。</li>
    <li><b>Authorization:</b><br />
    <br />
    此标头定义客户机支持的身份验证方法。</li>
</ul>
<p>客户机可能会向服务器发送其他标头以指定其他信息。<br />
<br />
在 <b>[DenyHeaders]</b> 节中，您定义 URLScan 将拒绝的 HTTP 标头。如果 URLScan 收到的请求中包含此节中列出的任何标头，它将拒绝该请求。此节由 HTTP 标头列表组成，每个标头占一行。标头名后面必须跟一个冒号 (:)（例如 <b>Header-Name:</b>）。<br />
<br />
&nbsp;</p>
<h4 id="tocHeadRef">[AllowExtensions] 节和 [DenyExtensions] 节</h4>
<p><script type="text/javascript">
            loadTOCNode(3, 'summary');
        </script>大多数文件都有一个标识其文件类型的文件扩展名。例如，Word 文档的文件名一般以 .doc 结束，HTML 文件名一般以 .htm 或 .html 结束，纯文本文件名一般以 .txt 结束。<b>[AllowExtensions]</b> 节和 <b>[DenyExtensions]</b> 节允许您定义 URLScan 将禁止的扩展名。例如，您可以配置 URLScan 以拒绝对 .exe 文件的请求，防止 Web 用户在您的系统上执行应用程序。<br />
<br />
<b>[AllowExtensions]</b> 节和 <b>[DenyExtensions]</b> 节的语法相同。它们由文件扩展名列表组成，每个扩展名占一行。扩展名以句点 (.) 开头（例如 .ext）。<br />
<br />
URLScan 根据 <b>[Options]</b> 节中 <b>UseAllowExtensions</b> 的值来决定使用哪一节。默认情况下，此选项设置为 0。如果将 <b>UseAllowExtensions</b> 设置为 0，则 URLScan 仅拒绝对 <b>[DenyExtensions]</b> 节中列出的文件扩展名的请求。允许此节中未列出的任何文件扩展名。<b>[AllowExtensions]</b> 节被忽略。<br />
<br />
如果将 <b>UseAllowExtensions</b> 设置为 1，则 URLScan 拒绝对 <b>[AllowExtensions]</b> 节中未明确列出的任何文件扩展名的请求。仅允许对此节中列出的文件扩展名的请求。<b>[DenyExtensions]</b> 节被忽略。<br />
<br />
有关如何配置 URLScan 以允许对没有扩展名的文件的请求的其他信息，请单击下面的文章编号，以查看 Microsoft 知识库中相应的文章：</p>
<div class="indent"><a class="KBlink" href="http://support.microsoft.com/kb/312376/">312376</a>&nbsp; <span class="pLink">(http://support.microsoft.com/kb/312376/ ) </span>如何配置 URLScan 以在 IIS 中允许使用空扩展名的请求</div>
<h4 id="tocHeadRef">[DenyUrlSequences] 节</h4>
<p><script type="text/javascript">
            loadTOCNode(3, 'summary');
        </script>可以配置 URLScan 以禁止那些 URL 中包含某些字符序列的请求。例如，可以禁止那些包含两个连续句点 (..) 的请求，利用目录遍历漏洞的攻击中经常采用这种手段。要指定一个想要禁止的字符序列，请将此序列单独放在 <b>[DenyUrlSequences]</b> 节中的一行上。<br />
<br />
请注意，添加字符序列可能会对 Microsoft Exchange 的 Outlook Web Access (OWA) 产生负面影响。当您从 OWA 打开一个邮件时，该邮件的主题行包含在服务器所请求的 URL 中。由于 URLScan.ini 文件禁止任何包含百分号 (%) 和连字符 (&amp;) 的请求，因此，当用户尝试打开主题行为&ldquo;Sales increase by 100%&rdquo;或&ldquo;Bob &amp; Sue are coming to town&rdquo;的邮件时，会收到 404 错误信息。要解决此问题，可以从 <b>[DenyUrlSequences]</b> 节中删除这些序列。请注意，这样做会降低安全性，因为它有可能允许危险的请求到达服务器。&nbsp;<br />
&nbsp;</p>
<p>参考原文：<a href="http://support.microsoft.com/kb/326444/zh-cn">http://support.microsoft.com/kb/326444/zh-cn</a></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.anywolfs.com/liuhui/article.asp?id=421" /> 
	  <id>http://www.anywolfs.com/liuhui/default.asp?id=421</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[windows组件与相关的组件参数（用于无人值守安装）]]></title>
	  <author>
		 <name>jothui</name>
		 <uri>http://www.anywolfs.com/liuhui/</uri>
		 <email>jothui8@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://www.anywolfs.com/liuhui/default.asp?cateID=3" label="Systems" /> 
	  <updated>2009-05-06T13:26:53+08:00</updated>
	  <published>2009-05-06T13:26:53+08:00</published>
		  <summary type="html"><![CDATA[<p>原文：<a href="http://www.s-w-r.com/news_appendix.html">http://www.s-w-r.com/news_appendix.html</a><br />
<br />
&nbsp;</p>
<center>
<h1>APPPENDIX</h1>
</center>
<p><br />
<b><font size="4" face="Courier">Answer Files and UDFs</font></b></p>
<p><font size="4" face="Courier">When Windows NT Workstation or Windows NT Server is installed using the winnt /u:answer_file or winnt32 /u:answer_file command, the options specified in the answer file (Unattend.txt) are applied to the installation.<br />
If the /udf:uniqueness_database_file option is also specified on the winnt or winnt32 command line, the entries in the specified uniqueness database file (UDF) are also applied, overriding entries in the answer file.<br />
For information on editing and using answer files and UDFs, see Chapter 2, &quot;Customizing Setup,&quot; of the Windows NT Workstation 4.0 Resource Guide. This Appendix describes the sections and keys used in these files. Additional entries may be listed in the sample Unattend.txt file on the product compact disc.</font><font size="3" face="宋体"> </font></p>
<center><b>Sections in Answer Files and UDFs</b><br />
Information in the answer file is divided into sections. Each section begins with the section name in square brackets, on a line by itself. Each section may contain one or more keys, with associated values. Each key is a character string, recognizable by the Setup program, that controls an element of the configuration to be installed. For example, there is a key to specify the computername, a key to specify whether the primary partition is converted to NTFS, and a key to specify the time zone for the computer.<br />
The same sections and keys are used in the UDFs, provided they are used after text-mode setup. Information that the Setup program uses during text-mode setup can only be specified in the answer file, not in the UDF. <br />
</center>
<p>&nbsp;</p>
<p>The sections are:<br />
&nbsp;</p>
<p><b>[Unattended]</b> <br />
The keys in this section define the behavior of the Setup program during text mode setup. This section can only be specified in the answer file, not in the UDF.<br />
&nbsp;</p>
<p><b>[OEMBootFiles] </b><br />
To install onto x86 computers,<b> $OEM$\OEMFILES\TXTSETUP.OEM</b> and all files listed in it <b>(HALs and drivers)</b>, must be listed in this section. This section can only be specified in the answer file, not in the UDF.<br />
&nbsp;</p>
<p><b>[MassStorageDrivers]</b> <br />
This section is used to specify SCSI drivers. This section can only be specified in the answer file, not in the UDF.<br />
&nbsp;</p>
<p><b>[KeyboardDrivers]</b> <br />
This section is used to specify keyboard drivers. This section can only be specified in the answer file, not in the UDF.<br />
&nbsp;</p>
<p><b>[PointingDeviceDrivers]</b> <br />
This section is used to specify pointing device drivers. This section can only be specified in the answer file, not in the UDF.<br />
&nbsp;</p>
<p><b>[OEM_Ads]</b> <br />
This section describes a banner, logo, and background bitmap to be displayed during GUI-mode setup.<br />
&nbsp;</p>
<p><b>[DisplayDrivers]</b> <br />
This section is used to specify display drivers.<br />
&nbsp;</p>
<p><b>[Display]</b> <br />
This section is used to specify settings for video display.<br />
&nbsp;</p>
<p><b>[DetectedMassStorage]</b> <br />
This section is used to specify mass storage devices that Setup is to recognize, even if they are not physically present on the system at the time you perform the installation. This section can only be specified in the answer file, not in the UDF.<br />
&nbsp;</p>
<p><b>[GuiUnattended]</b> <br />
The keys in this section define the behavior of the Setup program during GUI mode setup.<br />
&nbsp;</p>
<p><b>[UserData]</b> <br />
The keys in this section specify information associated with each user or computer.<br />
&nbsp;</p>
<p><b>[LicenseFilePrintData]</b> <br />
This section pertains only to installations of Windows NT Server. It is used to supply information regarding the license agreement.<br />
&nbsp;</p>
<p><b>[Network]</b> <br />
This section is used to specify settings used for networking, such as protocols and adapters. If this section is not present, support for networking will not be installed.<br />
&nbsp;</p>
<p><b>[Modem]</b> <br />
This section header is used to identify whether a modem should be installed or not. It is used by RAS to install a modem if DeviceType = Modem is in the list of RAS parameters.<br />
Some of the keys in these sections point to additional sections, which you must create and name. For example, to install protocols other than the defaults, you need to use the InstallProtocols key in the <b>[Network]</b> section to identify the name of the section in which the protocols are listed. You must also create and populate the section pointed to in the Install Protocols key.<br />
&nbsp;</p>
<p>&nbsp;</p>
<center>Adding Specific Functionality to Your Customized Setup</center>
<p><br />
The keys you can add to the answer file or UDF are listed in the remainder of this Appendix, grouped according to the kind of effect they produce. <br />
&nbsp;</p>
<p>Preferred Options in the Retail Product<br />
These options affect the choices a user can make while installing the retail version of Windows NT Workstation.<br />
&nbsp;</p>
<p><b>Preserving Settings of Existing Windows NT Workstation Systems</b> <br />
By default, Setup installs Windows NT Workstation 4.0 with the retail default settings, except where different settings are specified in the answer file and the UDFs. As an option, you can have Setup upgrade existing installations of Windows NT Workstation, with the system settings intact.<br />
To preserve existing settings when upgrading from an earlier version of Windows NT Workstation, add the following line to the [Unattended] section:<br />
<b>NtUpgrade = manual | yes | no | single</b></p>
<p>Where:<br />
<b>manual</b> indicates that the user is to be prompted as to whether the existing installation is to be completely replaced, or upgraded with system settings intact. If the user chooses to replace the existing version, he or she will also be prompted to specify a directory in which to install Windows NT Workstation 4.0. If the user chooses to retain existing settings, the remainder of the settings in the answer file and in the UDF will be ignored.<br />
&nbsp;</p>
<p><b>yes</b> indicates that the existing installation of Windows NT Workstation is to be upgraded with system settings intact. If NtUpgrade = yes, the remainder of the settings in the answer file and in the UDF will be ignored. If multiple installations are detected, the settings in first installation detected are used. On x86-based systems, the system that is listed first in the Boot.ini file is the first installation detected. On Alpha AXP-based, MIPS-based, and PowerPC-based systems, the first installation is the first one listed in the Startup Environment.<br />
&nbsp;</p>
<p><b>no</b> indicates that the existing installation of Windows NT Workstation is to be completely replaced. The retail default settings will be used, except where keys in the answer file or UDF override them. This is the default option.<br />
&nbsp;</p>
<p><b>single</b> indicates that if only one existing installation of Windows NT Workstation is detected, it is to be upgraded with system settings intact. If multiple previous installations are detected, the user must indicate which settings are to be retained.<br />
This key can only be specified in the answer file, not in the UDF.</p>
<p><b>Preserving Settings of Existing Windows for Workgroups 3.1 or Windows 3.1 Systems</b> <br />
By default, Setup installs Windows NT Workstation 4.0 with the retail default settings, except where different settings are specified in the answer file and the UDFs. As an option, you can have Setup upgrade existing installations of Windows for Workgroups 3.1 or Windows 3.1, with the system settings intact. <br />
To preserve existing settings when upgrading from either of these systems, add the following line to the [Unattended] section: Win31Upgrade = yes | no<br />
&nbsp;</p>
<p>Where:<br />
<b>yes</b> indicates that if an existing installation of Windows for Workgroups 3.1 or Windows 3.1 is detected, the existing settings are to be preserved.<br />
&nbsp;</p>
<p><b>no</b> indicates that the existing installation of Windows NT Workstation is to be completely replaced. The retail default settings will be used, except where keys in the answer file or UDF override them. This is the default option.<br />
If any other values are supplied for the Win31Upgrade key, the user will be prompted to specify whether the settings should be retained.<br />
This key can only be specified in the answer file, not in the UDF. Specifying the Directory in Which to Install Windows NT Workstation You can specify the directory on the destination computer in which the files for Windows NT Workstation 4.0 are to reside. To do so, add the following line to the [Unattended] section: TargetPath = manual | * | path<br />
&nbsp;</p>
<p>Where: <br />
<b>manual</b> <br />
indicates that the user is to be prompted for a directory. * indicates that the Setup program is to generate a unique directory name, and place the Windows NT Workstation 4.0 files in that directory. This is the default option.<br />
&nbsp;</p>
<p><b>path</b> <br />
indicates the name of the directory in which the Windows NT Workstation 4.0 files are to be placed. If the directory does not exist, it will be created.<br />
This key can only be specified in the answer file, not in the UDF. Replacing OEM Files with Windows NT Workstation Product Files You can choose whether to replace older files that Setup finds on the system with files from the retail product that have the same name. By default, these files are overwritten. To specify whether to keep the older versions of such files, add the following line to the [Unattended] section: OverwriteOemFilesOnUpgrade = yes | no<br />
If any Windows NT file in the existing installation has been overwritten by another application, you must set OverwriteOEMFilesOnUpgrade = yes. This key can only be specified in the answer file, not in the UDF.</p>
<p><b>Converting to NTFS</b> <br />
In general, partitions greater than 512 MB should be converted to NTFS. To specify whether to convert the primary partition to NTFS during installation, add the following line to the [Unattended] section: FileSystem = ConvertNTFS | LeaveAlone<br />
<b>Specifying When to Configure Graphics Devices</b> <br />
By default, graphics devices are configured during Setup. However, you can specify that the graphics devices be configured the first time someone logs on to the new system. To specify when the graphics devices are to be configured, add the following line to the [Display] section: ConfigureAtLogon = 0 | 1<br />
If ConfigureAtLogon = 1, no specific video setting is made during setup. Instead, the user is prompted to select the screen resolution the first time the computer is started after setup. If ConfigureAtLogon = 0, graphics configuration will be done during setup. If this option is selected, the following other preconfiguration values may be set, also in the [Display] section: BitsPerPel = n XResolution = number_of_pixels YResolution = number_of_pixels VRefresh = n Flags = n<br />
If an entry has a value of 0, or the entry is not present, the defaults will be applied. <br />
Table A.1 Default Values for Video Settings <br />
Key Default Value <br />
BitsPerPel 8 If this is not a valid value, the lowest valid value is used. XResolution 640<br />
If this is not a valid value, the lowest valid value is used. YResolution 480<br />
If this is not a valid value, the lowest valid value is used. VRefresh 60 Hz<br />
If this is not a valid value, the lowest valid value is used. Flags Any that are available.<br />
For example, if all of these keys are set to = 0, the video settings would be 640x480, 256 colors, 60 Hz (as long as that mode exists). As another example, if BitsPerPel = 16 and all other values are set to 0, then the card will be configured in 640x480, 64 K colors, and 60 Hz (again, as long as that mode exists). Normally, the user is prompted to test the video settings. For an unattended installation, you might want the settings to be stored without testing. To specify whether the settings should be stored without testing, add the following line to the [Display] section: AutoConfirm = 0 | 1 <br />
If AutoConfirm = 0, or if it is not specified, the video settings specified elsewhere in the [Display] section are used, and the user must test the selected video mode in order to save the setting and continue with setup. <br />
If AutoConfirm = 1, the settings are stored with no user intervention.</p>
<p><b>Additional Files and Applications</b> <br />
This section describes keys you can add to the answer file or UDF to add your own files or information to the retail version of Windows NT Workstation. <br />
Displaying Your Company Information During Setup<br />
To specify your own advertising or information during GUI Mode Setup, the following section must exist:<br />
<b>[OEM_Ads]</b> <br />
Banner = text<br />
Logo = file_name{, n]<br />
Bitmap = file_name{, n]<br />
The value of the Banner key is the text string to be displayed as a banner in the upper left of the screen during GUI Mode Setup. The text must contain the substring &quot;Windows NT Workstation&quot; or &quot;Windows NT Server&quot; in order to be displayed. To create a multi-line banner, insert an asterisk (*) where a line break is to appear. If the Banner key is empty or does not contain the &quot;Windows NT Workstation&quot; or &quot;Windows NT Server&quot; substring, the Windows NT retail banner will be displayed.<br />
The value of the Logo key is the filename of a bitmap to be displayed in the upper right corner of the screen during GUI Mode Setup. If your bitmap is referenced in a dynamic link library (DLL), you can specify the name of the DLL followed by the resource ID. The DLL must be in $OEM$\Oemfiles, and the resource ID must be supplied in base-10 format. If only a file name is specified, it must be the name of a .bmp file in $OEM$\Oemfiles that contains the bitmap.<br />
If the Logo key is not specified, or its value is empty, or it specifies a non-existent bitmap, then the Windows NT retail bitmap will be displayed.<br />
The value of the Bitmap key is the name of a bitmap that is to be tiled as a background during end-user setup.<br />
If your bitmap is referenced in a dynamic link library (DLL), you can specify the name of the DLL followed by the resource ID. The DLL must be in $OEM$\Oemfiles, and the resource ID must be supplied in base-10 format. If only a file name is specified, it must be the name of a .bmp file in $OEM$\Oemfiles that contains the bitmap.<br />
If the Bitmap key is not specified, or its value is empty, or it specifies a non-existent bitmap, then the Windows NT retail bitmap will be displayed.<br />
For best results on VGA-based displays this bitmap should be exactly 640 x 480 pixels. On ARC computers (which do not necessarily use VGA mode during setup) other optimal sizes may be possible. If the bitmap is monochrome, it will be tinted blue when displayed (like the retail background bitmap, which is itself monochrome).</p>
<p><b>Running a Program Concurrently with Setup</b> <br />
To run a custom program concurrently with Setup, add the following line to the [GuiUnattended] section: DetachedProgram = path\filename<br />
where path and filename describe the location of the custom program. For example: DetachedProgram = c:\mt32\mtrun.exe<br />
To supply arguments to the custom program, add the following line to the [GuiUnattended] section: Arguments = path\filename/argument where path\filename indicates the path to the program and argument indicates the arguments you want to supply. For example: Arguments = c:\mt32\scriptl.pcd/H</p>
<p><b>Using Files You Supply in the Subdirectories of $OEM$</b> <br />
To include files you have added to customize the application, the following line must be present in the [Unattended] section: OemPreinstall = Yes <br />
A Yes value indicates that Windows NT Setup might need to install some OEM-supplied files located in subdirectories of $OEM$. The default value is No. The default is used when the OemPreinstall key is missing. The No value implies that Setup will perform a regular unattended installation. This key can only be specified in the answer file, not in the UDF. The keys described in the following sections are used only if OemPreinstall = Yes.</p>
<p><b>Installing Display Drivers</b> <br />
To install display drivers, include the following section: [DisplayDrivers] driver_description = Retail | OEM <br />
This section is optional. If the [DisplayDrivers] section is empty or absent, Setup will install all the Windows NT retail display drivers during Text Mode Setup. During GUI Mode Setup, any drivers that fail to initialize will be disabled.<br />
The driver_description value identifies the driver to be installed. This value must match one of the strings defined in the right-hand side of the [Display] section of Txtsetup.sif (except for the string &quot;Standard VGA (640x480, 16 colors)&quot; or Txtsetup.oem (for an OEM-supplied driver). This key can only be specified in the answer file, not in the UDF. This section is valid only if OemPreinstall = Yes.</p>
<p><b>Installing SCSI Drivers</b> <br />
To install SCSI drivers, include the following section: <br />
<b>[MassStorageDrivers]</b> <br />
driver_description = Retail | OEM .<br />
This section is optional. If the [MassStorageDrivers] section is empty or absent, Setup will attempt to detect and install all known miniport drivers. The driver_description value identifies the driver to be installed. This value must match one of the strings defined in the [SCSI] section of Txtsetup.sif or Txtsetup.oem (for an OEM-supplied driver). This key can only be specified in the answer file, not in the UDF. This section is valid only if OemPreinstall = Yes.</p>
<p><b>Installing Keyboard Drivers</b> <br />
To specify keyboard drivers to be installed, include the following section: <b>[KeyboardDrivers]</b> <br />
driver_description = Retail | OEM .<br />
This section is optional. If the [KeyboardDrivers] section is absent or empty, Setup will detect and install a keyboard driver from the retail Windows NT product. The driver_description value identifies the driver to be installed. This string must match one of the strings defined in the [Keyboard] section of the Txtsetup.sif or Txtsetup.oem (for an OEM-supplied driver). This key can only be specified in the answer file, not in the UDF. This section is valid only if OemPreinstall = Yes.</p>
<p><b>Installing Pointing Device Drivers</b> <br />
To install pointing device drivers, include the following section <br />
<b>[PointingDeviceDrivers]</b> <br />
driver_description = Retail | OEM .<br />
This section is optional. If the [PointingDeviceDrivers] section is absent or empty, Setup will detect and install a pointing device driver from the retail Windows NT product. The driver_description value identifies the driver to be installed. This string must match one of the strings defined in the [Mouse] section of Txtsetup.sif or Txtsetup.oem (for an OEM-supplied driver). This key can only be specified in the answer file, not in the UDF. This section is valid only if OemPreinstall = Yes.</p>
<p><b>Networking Options</b> <br />
If networking is to be installed, you must include a [Network] section. If this section header is missing, network installation will be skipped. If the section is present but empty, the user will be presented with various error messages. Specifying Manual Installation of Network Components If you want the network components to be installed interactively during an otherwise unattended installation, include the following line in the [Network] section: Attend = Yes <br />
For the installation of network components to proceed without user intervention, this key must be absent.<br />
<b>Detecting Network Adapters</b> <br />
To detect network adapter cards installed on a computer, the following must be specified under the [Network] section: DetectAdapters = adapters_section[,adapters_section]. . . <br />
The value for the DetectAdapters key is a user-defined section name. For example, you could name a section [DetectAdaptersData] and specify it in this key. Create this section, and add to it the following keys:<br />
DetectCount = number_of_cards_to_detect<br />
LimitTo = inf_option [, inf_option] . . .<br />
inf_option = parameter_section<br />
The DetectCount key specifies the number of detection attempts Setup should make. The default is 1. If more cards than the number specified in DetectCount are present, the additional cards will not be detected.<br />
The LimitTo key specifies a list of cards; detection will be limited to cards in that list. If this key is not present, any detectable adapters will be installed. The values can be obtained from the network-adapter INF files.<br />
Each inf_option listed in the LimitTo key can also be listed as a key. The value of these keys will be the parameter normally associated with a network adapter. The values listed here will override detected values. <br />
To detect and install only the first network adapter card, use following line under the [Network] section: DetectAdapters = &quot;&quot;<br />
Note that there is no space between the beginning and end quotation marks. If neither the DetectAdapters key nor the InstallAdapters key (described under &quot;Installing Network Adapter&quot; later in this appendix) is present, user participation will be required. If DetectAdapters is present but contains no value, then the first adapter is detected and installed. The DetectAdapters and InstallAdapters keys can both be present.<br />
Example [Network] InstallProtocols = SelectedProtocolsList [SelectedProtocolsList] TC = TCPIPParameters ATALK = AppleTalkParameters</p>
<p><b>Installing Network Adapters</b> <br />
To install network adapters, the following key must be included in the [Network] section: InstallAdapters = adapters_list_section[, adapters_list_section]. . . <br />
The value for the InstallAdapters key is a user-defined section name. For example, you could name a section [InstallAdaptersList] and specify it in this key. All network adapters listed in the [InstallAdaptersList] section would then be installed. Create this section, and add to it a line for each adapter to be installed, using the following format: inf_option = parameter_section[, oem_path] <br />
If the InstallAdapters key and the DetectAdapters key are not present, user participation will be required. <br />
Each inf_option key in this section defines the inf_option to be installed. The answers for the inf_option key are adapter-specific. If the adapter is an OEM-supplied card, the path can be specified. <br />
Example <br />
<b>[Network]</b> <br />
InstallAdapters = SelectedAdaptersList <br />
[SelectedAdaptersList] NE2000 = NovelParameters ELNKII = 3ComParameters MSNETULTRA = MacrosoftNetUltraParameters, A:\ <br />
<b>Note</b> <br />
For network adapters, you must know and specify the necessary parameters for the cards you want to preinstall. To determine whether a card supports unattended setup, search for stf_unattended in the INFs for that card. <br />
<b>Installing Network Services</b> <br />
To install network services, the following keys should be specified under the [Network] section: InstallServices = services_list_section[, services_list_section] . . . <br />
All services listed will be installed. If the InstallServices key is absent, no extra services will be installed. <br />
The value for the InstallServices key is a user-defined section name. Create the section named by the InstallServices key, and in it list the service to be installed, using the following syntax: inf_option = parameter_section[, oem_path] <br />
Each inf_option key in this section defines the options to be installed. The value for this key is a user-defined section name and the OEM source path, if necessary. Create the section named by the inf_option key, and in it list the parameters to be used. <br />
Example <br />
[Network] InstallServices = SelectedServicesList [SelectedServicesList] SFM = ServicesForMacParameters WINS = WINServiceParameters</p>
<p><b>Installing Network Protocols</b> <br />
To detect network adapter cards installed on a computer, the following must be specified under the [Network] section: <br />
InstallProtocols = protocol_list_section[, protocol_list_section] . . . <br />
The value for the InstallProtocols key is a user-defined section name. For example, you could name a section [InstallProtocolsList] and specify it in this key. Create this section, and add to it a line for each protocol to be installed, using the following format: <br />
inf_option = parameter_section[, oem_path] <br />
The value on the left of the equals sign, inf_option, is the notation for the protocol, as it appears in the [Options] section of the INF file for that protocol. Protocol INFs have the filename Oemxpxx.inf, where xx refers to a particular protocol. The value on the right of the equals sign is a user-defined section name and the OEM source path, if necessary. Create the section named by the inf_option key, and in it list the parameters to be used for that protocol. <br />
All protocols listed will be installed. If this key is not present, the default protocols will be installed and user participation might be required for Setup to continue. <br />
Specifying the TCP/IP protocol is one case within the general topic of installing protocols, and is discussed in the section, &quot;Installing TCP/IP.&quot; <br />
Example <br />
[Network] InstallProtocols = SelectedProtocolsList <br />
[SelectedProtocolsList] TC = TCPIPParameters ATALK = AppleTalkParameters <br />
<b>Installing NetBEUI</b> <br />
To install NetBEUI, it must be specified in the &quot;protocol_list_section&quot; section specified by the InstallProtocols key described in the [Network] section. This is described under &quot;Installing Network Protocols&quot; earlier in this Appendix. In the protocol_list_section, include the following line: NBF = NetBEUI_parameters_section <br />
The section you specify as the value for NBF must exist, but is empty since NetBEUI does not require any parameters. For example, your answer file might include the following lines: [Network] InstallProtocols = SelectedProtocolsList <br />
[SelectedProtocolsList] NBF = NetBEUI_params TC = TCPIPParameters <br />
[NetBEUI_params] <br />
[TCPIPParameters]</p>
<p><b>Installing TCP/IP</b> <br />
To install TCP/IP, it must be specified in the section specified by the InstallProtocols key described in the [Network] section. This is described under &quot;Installing Network Protocols&quot; earlier in this Appendix. Create a separate section for the parameters, and refer to it in the section specified by the InstallProtocols key<br />
The supported TCP/IP parameters are as follows: <br />
DHCP = Yes | No <br />
ScopeID = scope_ID <br />
If you have set DHCP = No, you must also provide the following parameters. For a discussion of these parameters see Chapter 7, &quot;Using Microsoft DHCP Servers,&quot; in the Windows NT Server Networking Guide.<br />
IPAddress = ddd.ddd.ddd.ddd <br />
Subnet = ddd.ddd.ddd.ddd <br />
Gateway = ddd.ddd.ddd.ddd <br />
DNSServer = IPAddress, IPAddress, IPAddress<br />
;Up to 3 IP addresses can be specified<br />
WINSPrimary = IPAddress<br />
WINSSecondary = IPAddress<br />
DNSName = DNS_Domain_Name<br />
Both TCP/IP and SNMP allow you to configure computers on a site basis and/or on a computer-specific basis. A site-based configuration configures each computer with identical parameters, whereas a computer-specific configuration allows a computer to have unique parameters. These two configurations can be mixed together. The generic or site-specific parameters are processed first. If computer-specific parameters exist, they are overlaid on the site-specific ones. Example: TCP/IP without DHCP <br />
<b>[Network]</b> <br />
InstallProtocols = SelectedProtocolsList <br />
[SelectedProtocolsList] <br />
TC = TCPIPParameters <br />
[TCPIPParameters] <br />
DHCP = NO<br />
IPAddress = 192.9.1.1 <br />
Subnet = 255.0.0.0<br />
Gateway = 111.1.1.1<br />
DNSServer = 192.9.1.7, 192.9.1.8, 192.9.1.9<br />
WINSPrimary = 111.2.2.2<br />
WINSSecondary = 111.3.3.3<br />
DNSName = microsoft.com<br />
ScopeID = This_is_the_scope_id<br />
Example: TCP/IP with DHCP, and adding DNS and WINS parameters<br />
<b>[Network]</b> <br />
InstallProtocols = SelectedProtocolsList <br />
[SelectedProtocolsList] TC = TCPIPParameters <br />
[TCPIPParameters] <br />
DHCP = YES<br />
DNSServer = 192.9.1.7, 192.9.1.8, 192.9.1.9<br />
WINSPrimary = 111.2.2.2<br />
DNSName = microsoft.com<br />
ScopeID = This_is_the_scope_id<br />
&nbsp;</p>
<p><b>Installing the SNMP Service</b> <br />
To install the Simple Network Management Protocol (SNMP) service, it must be specified in the section that you create and that you specify in the InstallServices key. The InstallServices key is described under &quot;Installing Network Services&quot; earlier in this Appendix. On the line that specifies the protocol, you name the section (also created by you) that contains the parameters for the protocol. This is illustrated in the example at the end of this section. <br />
The supported parameters are as follows:<br />
Accept_CommunityName = Name1, Name2, Name3 ;maximum of 3 names<br />
Send_Authentication = Yes | No<br />
Any_Host = Yes | No<br />
Limit_Host = host1, host2, host3 ;limit to 3 hosts<br />
Community_Name = name<br />
Traps = IPaddress | IPXaddress ;maximum of 3 addresses<br />
Contact_Name = name ;limit to 1 name<br />
Location = location_name ;limit to 1 name<br />
<br />
Service = Physical, Applications, Datalink, Internet, EndToEnd ; Any combination is valid <br />
For a discussion of these parameters, see Chapter 11, &quot;Using SNMP for Network Management,&quot; in the Windows NT Server Networking Guide. If a parameter is an IP address, all four octets must be specified in dotted decimal notation only. Both TCP/IP and SNMP allow you to configure computers on a site basis and/or on a computer-specific basis. A site-based configuration configures each computer with identical parameters, whereas a computer-specific configuration allows a computer to have unique parameters. These two configurations can be mixed together. The generic or site-specific parameters are processed first. If computer-specific parameters exist, they are overlaid on the site-specific ones. <br />
<br />
Example [Network]<br />
InstallServices = SelectedServicesList <br />
[SelectedServicesList]<br />
SNMP = SNMPParameters <br />
[SNMPParameters]<br />
Accept_CommunityName = MicrosoftCommunity<br />
Send_Authentication = YES<br />
Any_Host = NO <br />
Limit_Host = HostSystem <br />
Community_Name = MyCommunity<br />
Traps = 1234567890AB, 192.001.001, 3456123456<br />
Contact_Name = NT_Administration<br />
Location = Building_26<br />
Service = Physical, Datalink, Internet<br />
&nbsp;</p>
<p><b>Installing NWLNKIPX</b> <br />
To install NWLNKIPX, it must be specified in the &quot;protocol_list_section&quot; section specified by the InstallProtocols key described in the [Network] section. This is described under &quot;Installing Network Protocols&quot; earlier in this Appendix. In the protocol_list_section, include the following line: NWLNKIPX = NetBEUI_parameters_section <br />
The section you specify as the value for NWLNKIPX must exist, but is empty since NWLNKIPX does not require any parameters. For example, your answer file might include the following lines:<br />
[Network]<br />
InstallProtocols = SelectedProtocolsList<br />
[SelectedProtocolsList]<br />
NWLNKIPX = NWLNKIPX _params<br />
TC = TCPIPParameters<br />
[NWLNKIPX _params]<br />
[TCPIPParameters] . . .</p>
<p><b>Installing Client Service for NetWare (NWWKSTA Option)</b> <br />
To install Client Service for NetWare, it must be specified in the section specified by the InstallServices key (the InstallServices key is included in the [Network] section). To the section specified by the InstallServices key, add the following line:<br />
NWWKSTA = NetWareClientParametersSection <br />
You can assign any name for the NetWareClientParametersSection. Create a section with that name and specify the NetWare client parameters that you want to use in that section. The recognized parameters are as follows:<br />
<br />
DefaultLocation = server_location DefaultScriptOptions = 0 | 1 | 3 <br />
DefaultLocation identifies the default logon server for the NetWare client. The DefaultScriptOptions key specifies the default action to take with scripts, and can be assigned any of the following values:<br />
0 Do not run a script<br />
1 Run NW 3.x level scripts only<br />
3 Run NW 3.x or NW 4.x scripts<br />
Example<br />
[Network]<br />
InstallServices = SelectedServicesList <br />
[SelectedServicesList]<br />
NWWKSTA = ClientNetwareParameters <br />
[ClientNetwareParameters]<br />
DefaultLocation = NWServer<br />
DefaultScriptOptions = 0</p>
<p><b>Installing Remote Access Service (RAS)</b> <br />
To install Remote Access Service (RAS), include the following line in the section you defined with the InstallServices key in the [Network] section:<br />
RAS = RAS_parameters_section<br />
where RAS_parameters_section is a section that you define and use to specify the following parameters:<br />
PortSections = MYCOM1, MYCOM2, MYCOM3-25<br />
DialoutProtocols = TCP/IP | IPX | NETBEUI | ALL<br />
DialinProtocols = TCP/IP | IPX | NETBEUI | ALL <br />
NetBEUIClientAccess = Network | ThisComputer<br />
TcpIpClientAccess = Network | ThisComputer <br />
UseDHCP = YES | NO<br />
StaticAddressBegin = IP_address<br />
StaticAddressEnd IP_address<br />
ExcludeAddress = IP_address1-IP_address2<br />
ClientCanRequestIPAddress = YES | NO<br />
IpxClientAccess = Network | ThisComputer<br />
AutomaticNetworkNumbers = YES | NO<br />
NetworkNumberFrom = IPX_net_number <br />
AssignSameNetworkNumber = YES | NO<br />
ClientsCanRequestIpxNodeNumber YES | NO<br />
Defaults and restrictions are as follows:<br />
PortSections Any number of port section names <br />
DialoutProtocols ALL implies all installed protocols<br />
DialinProtocols ALL implies all installed protocols<br />
NetBEUIClientAccess Default is Network<br />
TcpIpClientAccess Default is Network<br />
UseDHCP Default is YES<br />
StaticAddressBegin Required if UseDHCP = NO<br />
StaticAddressEnd Required if UseDHCP = NO<br />
ExcludeAddress One or more ranges, comma separated. <br />
StaticAddressBegin and StaticAddressEnd should be specified.<br />
ClientCanRequestIPAddress Default is NO<br />
IpxClientAccess Default is Network<br />
AutomaticNetworkNumbers Default is YES<br />
NetworkNumberFrom 1 to 0xFFFFFFFE; required if AutomaticNetworkNumbers is NO<br />
AssignSameNetworkNumber Default is YES<br />
ClientsCanRequestIpxNodeNumber Default is NO<br />
DeviceType = Modem <br />
If you have specified a &quot;PortSection&quot; you must create the section, which can have the following keys:<br />
PortName = COM1 | COM2 | COM3-COM25<br />
DeviceType = Modem<br />
DeviceName = device_name<br />
PortUsage = DialOut | DialIn | DialInOut</p>
<p>Where:<br />
<b>PortName</b> indicates the names of the ports to be configured in a particular port section.<br />
<b>DeviceType</b> indicates the type of device RAS should install. For the current release of Windows NT Workstation, the only available device type is a modem. If DeviceType = Modem, the InstallModem key must be included in the [Modem] section.<br />
<b>DeviceName</b> specifies the name of the device to be installed. <b>PortUsage</b> defines the dialing properties for the ports being configured. <br />
For a discussion of RAS features and parameters, see Chapter 5, &quot;Understanding Remote Access Service,&quot; in the Networking Supplement included with the product documentation. Example: RAS Using One Dialout Port<br />
[Network]<br />
InstallServices = SelectedServicesList</p>
<p>[SelectedServicesList]<br />
RAS = RemoteAccessParameters</p>
<p>[RemoteAccessParameters]<br />
PortSections = MYCOM1<br />
DialoutProtocols = TCP/IP</p>
<p>[MYCOM1]<br />
PortName = COM1<br />
DeviceType = Modem<br />
DeviceName = &quot;Intel Fax Modem 144e&quot;<br />
PortUsage = DialOut</p>
<p>Example: RAS Using One Dialout, One Dialin and Four Dialin and Dialout Ports, With All Installed Protocols<br />
This configuration uses default values for all protocols:<br />
[Network]<br />
InstallServices = SelectedServicesList</p>
<p>[SelectedServicesList]<br />
RAS = RemoteAccessParameters</p>
<p>[RemoteAccessParameters]<br />
PortSections = Dialin, Dialout, Dialinout<br />
DialoutProtocols = ALL<br />
DialinProtocols = ALL</p>
<p>[Dialin]<br />
PortName = COM1<br />
DeviceType = Modem<br />
DeviceName = &quot;USR Sportster V.34&quot;<br />
PortUsage = DialOut</p>
<p>[Dialout]<br />
PortName = COM2<br />
DeviceType = Modem<br />
DeviceName = &quot;USR Sportster V.34&quot;<br />
PortUsage = DialOut</p>
<p>[Dialinout]<br />
PortName = COM3-COM6<br />
DeviceType = Modem<br />
DeviceName = &quot;USR Sportster V.34&quot;<br />
PortUsage = DialInOut</p>
<p>Example: RAS 16 Dialin Ports, With TCP/IP and DHCP Enabled<br />
[Network]<br />
InstallServices = SelectedServicesList</p>
<p><b>[SelectedServicesList]</b><br />
RAS = RemoteAccessParameters</p>
<p><b>[RemoteAccessParameters]</b><br />
PortSections = InternetPorts<br />
DialoutProtocols = TCP/IP<br />
DialinProtocols = TCP/IP<br />
TcpIpClientAccess = Network<br />
UseDHCP = YES<br />
ClientCanRequestIPAddress = NO</p>
<p><b>[InternetPorts]</b><br />
PortName = COM3-COM17<br />
DeviceType = Modem<br />
DeviceName = &quot;USR Sportster V.34&quot;<br />
PortUsage = DialIn</p>
<p>Example: RAS 16 Dialin Ports, With TCP/IP and Static IP Address Pool<br />
[Network]<br />
InstallServices = SelectedServicesList <b>[SelectedServicesList]</b><br />
RAS = RemoteAccessParameters</p>
<p><b>[RemoteAccessParameters]</b><br />
PortSections = InternetPorts<br />
DialoutProtocols = TCP/IP<br />
DialinProtocols = TCP/IP<br />
TcpIpClientAccess = Network<br />
UseDHCP = NO<br />
StaticAddressBegin = 101.16.1.1<br />
StaticAddressEnd = 101.16.1.16<br />
ClientCanRequestIPAddress = NO</p>
<p><b>[InternetPorts]</b> PortName = COM3-COM17<br />
DeviceType = Modem<br />
DeviceName = &quot;USR Sportster V.34&quot;<br />
PortUsage = DialIn</p>
<p>Example: RAS 16 Dialin Ports, With IPX and Static IPX Address Pool<br />
[Network]<br />
InstallServices = SelectedServicesList</p>
<p><b>[SelectedServicesList]</b><br />
RAS = RemoteAccessParameters</p>
<p><b>[RemoteAccessParameters]</b><br />
PortSections = InternetPorts<br />
DialoutProtocols = IPX<br />
DialinProtocols = IPX<br />
IpxClientAccess = Network<br />
AutomaticNetworkNumbers = NO<br />
NetworkNumberFrom = 0xa100<br />
AssignSameNetworkNumber = NO<br />
ClientsCanRequestIpxNodeNumber = NO</p>
<p><b>[InternetPorts]</b><br />
PortName = COM3-COM17<br />
DeviceType = Modem<br />
DeviceName = &quot;USR Sportster V.34&quot;<br />
PortUsage = DialIn</p>
<p><b>Hardware Support</b><br />
This section describes keys you can add to specify what hardware is detected during setup, and what hardware support is installed.<br />
<b>Installing a Modem Driver for Use with RAS</b><br />
If the RAS parameters include the line DeviceType = Modem, the following line must be included in the [Modem] section:<br />
InstallModem = Modem _Parameter_Section <br />
where Modem_Parameter_Section is a section that you create and give any name you choose. This section contains the parameters required to install the modem on a specified COM port. If the section is empty, RAS will detect modems on its pre-configured ports and install any modem it finds. The [Modem_Parameter_Section] contains one line for each COM port on which a modem is to be installed, using the following syntax:<br />
[Modem_Parameter_Section]<br />
COMx = &quot;description&quot; [,Manufacturer, Provider]</p>
<p>Where:<br />
COMx<br />
identifies the COM port on which the modem is to be installed (for example COM1, COM2?<br />
description<br />
must match a modem description in a Mdmxxxxx.inf file that corresponds to the modem to be installed. This string must be enclosed in quotes. Manufacturer<br />
is an optional field that identifies the manufacturer of a particular modem when description is not unique to a particular manufacturer. Provider<br />
is an optional field that identifies the provider of a particular modem when description is not unique to a particular manufacturer.</p>
<p><b>Using Hardware Detected by Setup</b><br />
You can have the user confirm the hardware and mass storage devices detected by Setup, or you can specify that Setup proceed with the installation without seeking confirmation. Mass storage devices include any devices controlled by a SCSI mini port driver. For example, all CD-ROM drives, SCSI adapters, and hard drive controllers (except ATdisk, abiosdsk, and standard floppy disks) are mass storage devices.<br />
To specify whether the user is to confirm the hardware detected, add the following line to the [Unattended] section:<br />
ConfirmHardware = yes | no</p>
<p>Yes indicates that the user must confirm hardware and mass storage devices detected by the Setup program. No indicates that the Setup program should use hardware detected by the Setup program.<br />
This key can only be specified in the answer file, not in the UDF.</p>
<p><b>Note</b><br />
If OEMPreinstall = yes, then the ConfirmHardware key is ignored. <br />
<b>Specifying Mass Storage Devices</b><br />
When installing onto an x86-based computer, you can have Setup prepare the system for mass storage devices you specify, even if they are not physically present on the system at the time you perform the installation. To do so, add the section [DetectedMassStorage]. Copy the entries for the devices you want to specify from the [SCSI] section of the Txtsetup.sif file. This file is on the Setup boot floppy disks. This section can only be specified in the answer file, not in the UDF.<br />
If this section is present and contains entries, support for the specified devices will be included in the installation, as if the devices had actually been detected by Setup. <br />
If this section is present and has no entries, the result is the same as if Setup detected no mass storage devices.<br />
If this section is not present, Setup will attempt to detect the mass storage devices on the computer by loading all known miniport drivers.</p>
<p><b>Specifying a Keyboard Layout</b><br />
To specify a keyboard layout, add the following line to the [Unattended] section: KeyboardLayout = layout_description <br />
This key is optional. If the KeyboardLayout key is not specified or is absent, Setup will detect and install a keyboard layout from the retail Windows NT Workstation product.<br />
The layout_description value must match one of the strings in the [KeyboardLayout] section of Txtsetup.sif. <br />
This key can only be specified in the answer file, not in the UDF. Per-user Settings<br />
For a completely unattended installation, you must specify user settings in either the answer file or the UDF.</p>
<p><b>Specifying User Data</b><br />
If the user's full name, the organization name, the computer name, and a product ID for the copy of Windows NT Workstation are not provided to the Setup program, the user will be prompted for them. This information can be included in an answer file, but it is generally more effective to provide it in a UDF. Indeed, the UDF functionality is designed to allow you specify a variant of the basic configuration for each user, rather than create separate answer files, one for each user, with most of the information copied in each answer file.<br />
The section and keys are the same, whether you specify the data in an answer file or UDF. In the [UserData] section, add the following lines:<br />
FullName = &quot;User's full name&quot;<br />
orgName = &quot;Organization name&quot;<br />
ComputerName = computername<br />
ProductId = &quot;123-456789012345&quot;</p>
<p>The ProductId key specifies the Microsoft product identification number. This must be an authentic number that will be requested by Microsoft Product Support Services if you call for technical support. Note that you must include the hyphen in the product identification number. Note also that for the FullName, orgName, and ProductId keys, the value must be enclosed in quotation marks.</p>
<p><b>Specifying a Time Zone</b><br />
If no time zone is specified, the user will be prompted to select one. To specify a time zone, add the following line to the [GuiUnattended] section:<br />
TimeZone = &quot;time_zone&quot; <br />
Where time_zone is one of the following:<br />
(GMT) Greenwich Mean Time; Dublin, Edinburgh, London<br />
(GMT+01:00) Lisbon, Warsaw<br />
(GMT+01:00) Paris, Madrid<br />
(GMT+01:00) Berlin, Stockholm, Rome, Bern, Brussels, Vienna<br />
(GMT+02:00) Eastern Europe<br />
(GMT+01:00) Prague<br />
(GMT+02:00) Athens, Helsinki, Istanbul<br />
(GMT-03:00) Rio de Janeiro<br />
(GMT-04:00) Atlantic Time (Canada)<br />
(GMT-05:00) Eastern Time (US &amp; Canada)<br />
(GMT-06:00) Central Time (US &amp; Canada)<br />
(GMT-07:00) Mountain Time (US &amp; Canada)<br />
(GMT-08:00) Pacific Time (US &amp; Canada); Tijuana<br />
(GMT-09:00) Alaska<br />
(GMT-10:00) Hawaii<br />
(GMT-11:00) Midway Island, Samoa<br />
(GMT+12:00) Wellington<br />
(GMT+10:00) Brisbane, Melbourne, Sydney<br />
(GMT+09:30) Adelaide<br />
(GMT+09:00) Tokyo, Osaka, Sapporo, Seoul, Yakutsk<br />
(GMT+08:00) Hong Kong, Perth, Singapore, Taipei<br />
(GMT+07:00) Bangkok, Jakarta, Hanoi<br />
(GMT+05:30) Bombay, Calcutta, Madras, New Delhi, Colombo<br />
(GMT+04:00) Abu Dhabi, Muscat, Tbilisi, Kazan, Volgograd<br />
(GMT+03:30) Tehran<br />
(GMT+03:00) Baghdad, Kuwait, Nairobi, Riyadh<br />
(GMT+02:00) Israel<br />
(GMT-03:30) Newfoundland<br />
(GMT-01:00) Azores, Cape Verde Is.<br />
(GMT-02:00) Mid-Atlantic<br />
(GMT) Monrovia, Casablanca<br />
(GMT-03:00) Buenos Aires, Georgetown<br />
(GMT-04:00) Caracas, La Paz<br />
(GMT-05:00) Indiana (East)<br />
(GMT-05:00) Bogota, Lima<br />
(GMT-06:00) Saskatchewan<br />
(GMT-06:00) Mexico City, Tegucigalpa<br />
(GMT-07:00) Arizona<br />
(GMT-12:00) Enewetak, Kwajalein<br />
(GMT+12:00) Fiji, Kamchatka, Marshall Is.<br />
(GMT+11:00) Magadan, Soloman Is., New Caledonia<br />
(GMT+10:00) Hobart<br />
(GMT+10:00) Guam, Port Moresby, Vladivostok<br />
(GMT+09:30) Darwin<br />
(GMT+08:00) Beijing, Chongqing, Urumqi<br />
(GMT+06:00) Alma Ata, Dhaka<br />
(GMT+05:00) Islamabad, Karachi, Sverdlovsk, Tashkent<br />
(GMT+04:30) Kabul<br />
(GMT+02:00) Cairo<br />
(GMT+02:00) Harare, Pretoria<br />
(GMT+03:00) Moscow, St. Petersburg <br />
For example:<br />
TimeZone = &quot;(GMT-08:00) Pacific Time (US &amp; Canada); Tijuana&quot;</p>
<p><b>Joining a Workgroup or Domain</b><br />
The computer can be part of either a workgroup or a domain. If the computer is a server, a third option, domain controller, is available. The key for establishing the computer as a domain controller is described under &quot;Windows NT Server Settings,&quot; later in this appendix<br />
. To join a workgroup, the following key must be specified under the [Network] section:<br />
JoinWorkgroup = workgroup_name <br />
The workgroup_name value specifies the workgroup the computer will participate in. To join an existing domain, specify the following under the [Network] section: JoinDomain = domain_name <br />
The domain_name value specifies the domain to join. In the lab, you might also want to define user credentials (for example, Administrator) and password required to create a computer account on the domain specified. In this case you would add the following under the [Network] section: JoinDomain = domain_name<br />
CreateComputerAccount = [user_name_with_creation_rights [, user_password]</p>
<p>The CreateComputerAccount key supplies the credentials and password to create the computer account. The user account specified in the CreateComputerAccount key must already exist in the specified domain. <br />
The [Network] section must contain one of the keys JoinWorkgroup, JoinDomain, or InstallDC. The InstallDC key applies only to Windows NT Server, and is described under &quot;Installing a Domain Controller.&quot;</p>
<p><b>Windows NT Server Settings</b> The following options apply only to installations of Windows NT Server:<br />
Setting License Options<br />
When installing Windows NT Server, you must specify whether the server is licensed in &quot;per seat&quot; or &quot;per server&quot; mode. If this is not specified in the answer file, Setup will prompt for the information. <br />
To specify the license mode, add the following key to the [LicenseFilePrintData] section:<br />
AutoMode = PerSeat | PerServer <br />
If the AutoMode key is empty or missing, Setup prompts for the license mode. PerSeat indicates that a client access license has been purchased for each computer that accesses the server.<br />
PerServer indicates that client access licenses have been purchased for the server to allow a certain number of concurrent connections to the server. If AutoMode is set to PerServer, AutoUsers must also be specified, as follows: <br />
AutoUsers = n <br />
where n is the number of concurrent client connections that the server is licensed to support. This will be a number between 0 and 999999.<br />
If AutoMode = PerServer and AutoUsers is missing or empty, Setup will prompt for the number of concurrent client connections that the server is licensed to support. For information on the licensing modes, see Chapter 12, &quot;Licensing and License Manager,&quot; in the Concepts and Planning Guide included with the Windows NT Server retail product. The chapter includes a worksheet to help you decide which licensing mode is best for your organization.</p>
<p><b>Installing a Domain Controller</b><br />
When installing Windows NT Server, you can use the JoinWorkgroup or JoinDomain key in the [Network] section (as described under &quot;Joining a Workgroup or Domain&quot; earlier in this Appendix), or you can set the computer to be a domain controller. To establish the computer as a domain controller, add the following line to the [Network] section:<br />
InstallDC = domain_name <br />
If the specified domain does not exist, it will be created. This key is only valid if the server role has been set as a primary or backup domain controller and the AdvServerType key has been set accordingly.<br />
If you are creating a backup domain controller (BDC), add the following line to the [Network] section to define the user credentials and password required to create a computer account on the domain specified:<br />
CreateComputerAccount = [user_name_with_creation_rights<br />
[, user_password] <br />
The [Network] section must contain one of the keys JoinWorkgroup, JoinDomain, or InstallDC.<br />
Example: Creating a Backup Domain Controller for the Marketing Domain<br />
[Network]<br />
InstallDC = Marketing<br />
CreateComputerAccount = Administrator, FishScale <br />
A computer account is also created for this computer, using the Administrator account and supplying the password (FishScale) for the Administrator account.</p>
<p><b>Setting the Server Role</b><br />
A computer running Windows NT Server can be a standalone server, a primary domain controller (PDC), or a backup domain controller (BDC). To specify which role the computer is to have in the network, add the following line to the [GuiUnattended] section:<br />
AdvServerType = SERVERNT | LANMANNT | LANSECNT <br />
Where:<br />
SERVERNT indicates that the computer will be a standalone server.<br />
LANMANNT indicates that the computer will serve as a primary domain controller (PDC).<br />
LANSECNT indicates that the computer will be a backup domain controller (BDC).</p>
<p><b>Installing the Internet Information Server (NT Server Only)</b><br />
To install Internet Server on a Windows NT Server, add the following line to the [Network] section. This key is only valid for Windows NT Server, and will be ignored when installing Windows NT Workstation.<br />
InstallInternetServer = Internet_Server_Parameter_Section<br />
[Internet_Server_Parameter_Section] <br />
where Internet_Server_Parameter_Section is a section that you create, and that contains parameters for installing Internet Server.<br />
Example<br />
[Network]<br />
InstallInternetServer = InternetServerParameters<br />
[InternetServerParameters]<br />
Create a section called [INETSTP], and add some or all of the following keys, depending on the features you want to install, to that section:<br />
InstallINETSTP= 1 | 0<br />
InstallFTP=1 | 0<br />
InstallWWW=1 | 0<br />
InstallGOPHER=1 | 0<br />
InstallADMIN=1 | 0<br />
InstallMOSAIC=1 | 0<br />
InstallGATEWAY=1 | 0<br />
InstallDNS=1 | 0<br />
InstallHELP=1 | 0<br />
InstallSMALLPROX=1 | 0<br />
InstallCLIENTADMIN=1 | 0<br />
WWWRoot=c:\wwwroot<br />
FTPRoot=c:\ftproot<br />
GopherRoot=c:\gophroot<br />
InstallDir=c:\inetsrv<br />
EmailName=email_address<br />
UseGateway=1 | 0<br />
GatewaysList=\\gateway1 \\gateway2 <br />
Where the possible values for a key are 1 or 0; 1 means &quot;yes&quot; and 0 means &quot;no.&quot;<br />
The effects of these keys are shown in the following table:<br />
InstallINETSTP= Specifies whether Internet Services will be installed.<br />
InstallFTP= Specifies whether the FTP Service will be installed. <br />
InstallWWW= Specifies whether the WWW Service will be installed.<br />
InstallGOPHER= Specifies whether the Gopher Service will be installed.<br />
InstallADMIN= Specifies whether the Internet Administrator Manager will be installed.<br />
InstallMOSAIC= Specifies whether the Internet Explorer Browser will be installed.<br />
InstallGATEWAY= Specifies whether the Gateway Service will be installed.<br />
InstallDNS= Specifies whether the DNS Service will be installed.<br />
InstallHELP= Specifies whether the HELP Files will be installed. (Applies to Windows NT Workstation only.)<br />
InstallSMALLPROX= Specifies whether the Access Gateway Proxy will be installed. (Applies to Windows NT Workstation only.)<br />
InstallCLIENTADMIN= Specifies whether the client administrator tools will be installed. (Applies to Windows NT Workstation only.)<br />
WWWRoot=c:\wwwroot Specifies the virtual root for the WWW service.<br />
FTPRoot=c:\ftproot Specifies the virtual root for the FTP service.<br />
GopherRoot=c:\gophroot Specifies the virtual root for the Gopher service.<br />
InstallDir=c:\inetsrv Specifies the installation directory for all components of Internet Services.<br />
EmailName=email_name Specifies the Internet e-mail name of the user.<br />
UseGateway= Specifies whether a gateway is to be used.<br />
GatewaysList=\\gateway1 \\gateway2 Lists the gateways to be used (if UseGateway=1).</p>
<p><b>Using an Extended Partition for Text Mode Files</b><br />
If you are installing Windows NT Workstation on a disk larger than 2 GB, you can cause Setup to extend the partition on which the temporary files are located into any available unpartitioned space that physically follows it on the disk. These temporary files must be installed on a primary partition. The space used must be limited to 1024 cylinders. Writing beyond cylinder 1024 will cause the installation to fail.<br />
To control whether Setup extends the partition on which the temporary files are located, add the following line to the [Unattended] section: ExtendOemPartition = 0 | 1 <br />
Where:<br />
0<br />
specifies that the partition not be extended. 1<br />
specifies that the partition is to be extended. When the value is 1, you must set FileSystem = ConvertNTFS.</p>
<p><b>Stopping Setup Before GUI Mode Begins</b><br />
If OEMPreinstall = Yes, the Setup program stops at the end of text mode by default, rather than continuing into GUI mode. This gives you the ability to duplicate disks with the operating system and applications pre-installed. The first time a computer is started with the duplicated disk in place, the system boots into GUI mode. The user can then be prompted for information such as username, computername, and the Workgroup or Domain that the computer is to join.<br />
You can specify whether Setup continues into GUI mode at the end of text mode by adding the following line to the [Unattended] section:<br />
NoWaitAfterTextMode = 0 | 1<br />
Where:<br />
0<br />
specifies that Setup should stop at the end of text mode.<br />
1<br />
specifies that Setup should automatically reboot into GUI mode at the end of text mode.<br />
Sample Unattend.txt File<br />
[Unattended]<br />
Method = express<br />
TargetPath = srv1231</p>
<p>[GuiUnattended]<br />
AdvServerType = SERVERNT<br />
; AdvServerType = LANMANNT (PDC) | LANSECNT (BDC) | SERVERNT (STANDALONE)<br />
TimeZone = &quot;(GMT-08:00) Pacific Time (US &amp; Canada); Tijuana&quot;</p>
<p>[UserData]<br />
FullName = &quot;John L. Smith&quot;<br />
orgName = &quot;Microsoft&quot;<br />
ComputerName = JohnSm_1<br />
ProductId = &quot;123456789012345&quot;</p>
<p>[LicenseFilePrintData]<br />
AutoMode = PerSeat</p>
<p>[Network]<br />
DetectAdapters = DetectParams<br />
; InstallAdapters = AdaptersList<br />
InstallProtocols = ProtocolsList<br />
; InstallServices = ServicesList</p>
<p>; JoinWorkgroup = OurWorkGroup</p>
<p>JoinDomain = NTWKSTA<br />
CreateComputerAccount = JohnSm, FriedFrogs</p>
<p>; for a PDC install<br />
; InstallDC = Our_DOMAIN</p>
<p>; for a BDC install<br />
; InstallDC = Our_DOMAIN<br />
; CreateComputerAccount = Administrator, FishScale</p>
<p>[DetectParams]<br />
DetectCount = 1<br />
LimitTo = IEEPRO, ELNKII</p>
<p>[AdaptersList]<br />
IEEPRO = IntelEEProParams<br />
ELNKII = 3ComELIIParams</p>
<p>[ProtocolsList]<br />
TC = TCPIPParams<br />
; NBF = NetBEUIParams<br />
; NWLNKIPX = NWLinkIPXParams</p>
<p>[ServicesList]<br />
RAS = RemoteAccessParameters</p>
<p>[IntelEEProParams]<br />
Interrupt = 5<br />
IoChannelReady = 4<br />
Transceiver = 4<br />
IoAddress = 784</p>
<p>; irq = 5<br />
; i/o = 0x310<br />
; io channel = auto<br />
; transceiver = auto</p>
<p>[3ComELIIParams]<br />
InterruptNumber = 2<br />
IOBaseAddress = 512<br />
Transceiver = 2<br />
MemoryMapped = 0<br />
; where Transceiver = 1 - External; 2 - On Board<br />
; MemoryMapped = 1 - ON; 0 - OFF</p>
<p>; Optional:<br />
; !AutoNetInterfaceType = 0 | 1 | 2 ...<br />
; !AutoNetBusNumber = 0 | 1 | ...</p>
<p>[RemoteAccessParameters]<br />
PortSections = MYCOM1<br />
DialoutProtocols = TCP/IP</p>
<p>[MYCOM1]<br />
PortName = COM1<br />
DeviceType = Modem<br />
DeviceName = &quot;Intel Fax Modem 144e&quot;<br />
PortUsage = DialOut</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.anywolfs.com/liuhui/article.asp?id=420" /> 
	  <id>http://www.anywolfs.com/liuhui/default.asp?id=420</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[无人值守snmp自动安装]]></title>
	  <author>
		 <name>jothui</name>
		 <uri>http://www.anywolfs.com/liuhui/</uri>
		 <email>jothui8@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://www.anywolfs.com/liuhui/default.asp?cateID=3" label="Systems" /> 
	  <updated>2009-05-06T13:22:13+08:00</updated>
	  <published>2009-05-06T13:22:13+08:00</published>
		  <summary type="html"><![CDATA[<p>先举例子：</p>
<blockquote>
<p>&nbsp;echo &quot;更改windows安装文件的路径&quot; <br />
echo Windows Registry Editor Version 5.00 &gt; c:\Win2003setupPath.reg <br />
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup] &gt;&gt; c:\Win2003setupPath.reg <br />
echo &quot;ServicePackSourcePath&quot;=&quot;D:\\anywolfs&quot; &gt;&gt; c:\Win2003setupPath.reg <br />
echo &quot;SourcePath&quot;=&quot;D:\\anywolfs&quot; &gt;&gt; c:\Win2003setupPath.reg <br />
regedit /S c:\Win2003setupPath.reg <br />
del /f /s /q c:\Win2003setupPath.reg <br />
echo &quot;生成snmp无人值守安装选项文件&quot; <br />
echo [NetOptionalComponents] &gt; c:\snmp.txt <br />
echo SNMP = 1 &gt;&gt; c:\snmp.txt <br />
echo [SNMP] &gt;&gt; c:\snmp.txt <br />
echo Contact_Name =&nbsp;anywolfs &gt;&gt; c:\snmp.txt <br />
echo Location = anywolfs.com&gt;&gt; c:\snmp.txt <br />
echo Community_Name = anywolfs.com&gt;&gt; c:\snmp.txt <br />
echo Send_Authentication = Yes &gt;&gt; c:\snmp.txt <br />
echo Accept_CommunityName =anywolfs.com:Read_Only &gt;&gt; c:\snmp.txt <br />
echo Any_Host = No &gt;&gt; c:\snmp.txt <br />
echo Limit_Host = LocalHost, anywolfs.com&gt;&gt;c:\snmp.txt<br />
Sysocmgr.exe /i:sysoc.inf /u:c:\snmp.txt <br />
del /f /s /q c:\snmp.txt <br />
echo snmp安装完毕 <br />
&nbsp;</p>
</blockquote>
<p>注册表：&nbsp;<br />
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\ServicePackSourcePath<br />
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SourcePath<br />
两个键值是你放置I386的物理路径，比如我的安装所需文件都放置在D:\anywolfs\I386下，那么我就设置成&quot;ServicePackSourcePath&quot;=&quot;D:\\anywolfs&quot; ，记住不需要在路径后面再加I386了，系统会自己去识别。<br />
<br />
剩下的关于snmp的安装参数，请看下面这段说明：<br />
&nbsp;</p>
<p><font size="3"><b>SNMP Service Parameters</b> </font></p>
<p>This document explains and maps three related entities:</p>
<ul>
    <li>SNMP Service Properties, specifically the Agent, Traps, and Security tabs</li>
    <li>HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters registry values</li>
    <li>[SNMP] section of an answer file for use with WUI or SysOCMgr</li>
</ul>
<p>The service properties are a graphic interface to the registry values. The answer file provides a method for setting the registry values during installation of the service.</p>
<p>To open the SNMP Service Properties, right-click <b>My Computer</b>, select <b>Manage</b>. In the Computer Management console, expand <b>Services and Applications</b>, then select <b>Services</b>. Scroll to and double-click <b>SNMP Service</b>. Three tabs of this property page will be referred to below: <b>Agent</b>, <b>Traps</b>, and <b>Security</b>.</p>
<p>&nbsp;</p>
<p><font size="3"><b>Agent tab</b> </font></p>
<p>All parameters on the Agent tab set values under the following key:</p>
<blockquote><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\RFC1156Agent</font> </b></blockquote>
<p>
<table border="1" cellspacing="2" cellpadding="2">
    <tbody>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica"><b>GUI Property</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Registry Name</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Registry Type</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Registry Data</b> </font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica"><i>Contact</i> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">sysContact</font> </b></font></td>
            <td valign="top"><font size="2" face="arial,helvetica">REG_SZ</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">(string)</font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica"><i>Location</i> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">sysLocation</font> </b></font></td>
            <td valign="top"><font size="2" face="arial,helvetica">REG_SZ</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">(string)</font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica"><i>Service</i> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">sysServices</font> </b></font></td>
            <td valign="top"><font size="2" face="arial,helvetica">REG_DWORD</font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">0x01 (1)</font> </b>= Physical<br />
            <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">0x02 (2)</font></b> = Datalink and subnetwork<br />
            <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">0x04 (4)</font></b> = Internet<br />
            <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">0x08 (8)</font></b> = End-to-end<br />
            <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">0x40 (64)</font></b> = Applications<br />
            </font></td>
        </tr>
    </tbody>
</table>
</p>
<p><b>Answer file details</b></p>
<p>
<table border="1" cellspacing="2" cellpadding="2">
    <tbody>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Parameter</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Value(s)</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Default(s)</b> </font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica">Contact_Name</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">&quot;string&quot;</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">&nbsp;</font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica">Location</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">&quot;string&quot;</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">&nbsp;</font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica">Service</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">Physical, Applications, Datalink and subnetwork, Internet, End-to-End</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">Applications, Internet, End-to-End</font></td>
        </tr>
    </tbody>
</table>
</p>
<p>Example</p>
<p>
<table border="1" cellpadding="2" bgcolor="#cccccc">
    <tbody>
        <tr>
            <td align="left">
            <pre style="font-family: courier new,courier,monospace,arial,helvetica; margin-bottom: 0px; font-size: 12px">
[NetOptionalComponents]
SNMP = 1

[SNMP]
Contact_Name = &quot;Aaron Czechowski,1234&quot;
Location = &quot;CK 6&quot;
Service = Physical, Applications, End-to-End
</pre>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>yields</p>
<p>
<table border="1" cellpadding="2" bgcolor="#cccccc">
    <tbody>
        <tr>
            <td align="left">
            <pre style="font-family: courier new,courier,monospace,arial,helvetica; margin-bottom: 0px; font-size: 12px">
HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\RFC1156Agent[sysContact] = Aaron Czechowski,1234
HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\RFC1156Agent[sysLocation] = CK 6
HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\RFC1156Agent[sysServices] = 0x00000049 (73)
</pre>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>&nbsp;</p>
<p><font size="3"><b>Traps tab</b> </font></p>
<p>All parameters on the Traps tab set values under the following key:</p>
<blockquote><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration</font> </b></blockquote>
<p>Any <i>Community name</i> added to the list will create a subkey below the above path. For example, adding a <i>Community name</i>&nbsp;<b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">Towson1</font></b> will create the following key:</p>
<blockquote><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration\Towson1</font> </b></blockquote>
<p>All <i>Trap destinations</i> for each community will map to the following values under each community subkey:</p>
<p>
<table border="1" cellspacing="2" cellpadding="2">
    <tbody>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Name</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Type</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Data</b> </font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica">ordinal number<br />
            (e.g., <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">1</font></b>, <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">2</font></b>, <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">3</font></b>)</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">REG_SZ</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">&lt;trapDest_hostname&gt;<br />
            (e.g., <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">trap1.towson.edu</font></b>)</font></td>
        </tr>
    </tbody>
</table>
</p>
<p><b>Answer file details</b></p>
<p>
<table border="1" cellspacing="2" cellpadding="2">
    <tbody>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Parameter</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Value(s)</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Default(s)</b> </font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica">Community_Name</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">&lt;communityName&gt; <br />
            e.g., <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">Towson1</font></b></font></td>
            <td valign="top"><font size="2" face="arial,helvetica">&nbsp;</font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica">Traps</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">&lt;trapDest_hostname&gt;, ...<br />
            (e.g., <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">trap1.towson.edu</font></b>)</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">&nbsp;</font></td>
        </tr>
    </tbody>
</table>
</p>
<p>Example</p>
<p>
<table border="1" cellpadding="2" bgcolor="#cccccc">
    <tbody>
        <tr>
            <td align="left">
            <pre style="font-family: courier new,courier,monospace,arial,helvetica; margin-bottom: 0px; font-size: 12px">
[NetOptionalComponents]
SNMP = 1

[SNMP]
Community_Name = Towson1
Traps = trap1.towson.edu, trap2.towson.edu, trap3.towson.edu
</pre>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>yields</p>
<p>
<table border="1" cellpadding="2" bgcolor="#cccccc">
    <tbody>
        <tr>
            <td align="left">
            <pre style="font-family: courier new,courier,monospace,arial,helvetica; margin-bottom: 0px; font-size: 12px">
HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration\Towson1[1] = trap1.towson.edu
HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration\Towson1[2] = trap2.towson.edu
HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration\Towson1[3] = trap3.towson.edu
</pre>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>It does not seem to be possible to create multiple Community Names for traps from an answer file. Programmatically adding an additional Community Name to the Traps tab will require editing the registry.</p>
<p>&nbsp;</p>
<p><font size="3"><b>Security tab</b> </font></p>
<p>The <i>Send authentication trap</i> check box maps to the following registry key value:</p>
<blockquote><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters</font> </b></blockquote>
<p>
<table border="1" cellspacing="2" cellpadding="2">
    <tbody>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Name</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Type</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Data</b> </font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica"><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">EnableAuthenticationTraps</font> </b></font></td>
            <td valign="top"><font size="2" face="arial,helvetica">REG_DWORD</font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">0</font> </b>= disable<br />
            <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">1</font></b> = enable</font></td>
        </tr>
    </tbody>
</table>
</p>
<p>Adding a community to the <i>Accepted community names</i> list adds values to the following key:</p>
<blockquote><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities</font> </b></blockquote>
<p>The <i>Community Name</i> is the Name of the registry value and the <i>Community Rights</i> are the Data of the registry value.</p>
<p>
<table border="1" cellspacing="2" cellpadding="2">
    <tbody>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Name</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Type</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Data</b> </font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica">&lt;communityName&gt;<br />
            (e.g., <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">Towson1</font></b>)</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">REG_DWORD</font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">1</font> </b>= NONE<br />
            <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">2</font></b> = NOTIFY<br />
            <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">4</font></b> = READ ONLY<br />
            <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">8</font></b> = READ WRITE<br />
            <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">16</font></b> = READ Create </font></td>
        </tr>
    </tbody>
</table>
</p>
<p>Checking <i>Accept SNMP packets from these hosts</i> and adding a management host adds values to the following key:</p>
<blockquote><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\PermittedManagers</font> </b></blockquote>
<p>
<table border="1" cellspacing="2" cellpadding="2">
    <tbody>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Name</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Type</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Data</b> </font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica">ordinal number<br />
            (e.g., <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">1</font></b>, <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">2</font></b>, <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">3</font></b>)</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">REG_SZ</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">&lt;manager_hostName&gt;<br />
            (e.g., <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">accept1.towson.edu</font></b>)</font></td>
        </tr>
    </tbody>
</table>
</p>
<p><b>Answer file details</b></p>
<p>
<table border="1" cellspacing="2" cellpadding="2">
    <tbody>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Parameter</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Value(s)</b> </font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b>Default(s)</b> </font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica">Send_Authentication</font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">Yes</font> </b>| <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">No</font></b></font></td>
            <td valign="top"><font size="2" face="arial,helvetica">&nbsp;</font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica">Accept_CommunityName</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">&lt;communityName1&gt;:&lt;privilege&gt;, ...<br />
            (e.g., <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">Towson1:Read_Only</font></b>)</font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">public:Read_Only</font> </b></font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica">Any_Host</font></td>
            <td valign="top"><font size="2" face="arial,helvetica"><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">Yes</font> </b>| <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">No</font></b></font></td>
            <td valign="top"><font size="2" face="arial,helvetica">&nbsp;</font></td>
        </tr>
        <tr>
            <td valign="top"><font size="2" face="arial,helvetica">Limit_Host</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">&lt;hostname&gt;, ...<br />
            (e.g., <b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">trap1.towson.edu</font></b>)</font></td>
            <td valign="top"><font size="2" face="arial,helvetica">&nbsp;</font></td>
        </tr>
    </tbody>
</table>
</p>
<p>Example</p>
<p>
<table border="1" cellpadding="2" bgcolor="#cccccc">
    <tbody>
        <tr>
            <td align="left">
            <pre style="font-family: courier new,courier,monospace,arial,helvetica; margin-bottom: 0px; font-size: 12px">
[NetOptionalComponents]
SNMP = 1

[SNMP]
Send_Authentication = Yes
Accept_CommunityName = Towson1:Read_Only
Any_Host = Yes
Limit_Host = trap1.towson.edu, trap2.towson.edu
</pre>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>yields</p>
<p>
<table border="1" cellpadding="2" bgcolor="#cccccc">
    <tbody>
        <tr>
            <td align="left">
            <pre style="font-family: courier new,courier,monospace,arial,helvetica; margin-bottom: 0px; font-size: 12px">
HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters[EnableAuthenticationTraps] = 1
HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities[Towson1] = 4
HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\PermittedManagers[1] = trap1.towson.edu
HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\PermittedManagers[2] = trap2.towson.edu
</pre>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>&nbsp;</p>
<p><font size="3"><b>Unknown Registry Values</b> </font></p>
<p>The functionality of the following registry values is currently unknown:</p>
<ul>
    <li><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters</font> </b><br />
    <table border="1" cellspacing="2" cellpadding="2">
        <tbody>
            <tr>
                <td valign="top"><font size="2" face="arial,helvetica"><b>Name</b> </font></td>
                <td valign="top"><font size="2" face="arial,helvetica"><b>Type</b> </font></td>
                <td valign="top"><font size="2" face="arial,helvetica"><b>Data</b> </font></td>
            </tr>
            <tr>
                <td valign="top"><font size="2" face="arial,helvetica">NameResolutionRetries</font></td>
                <td valign="top"><font size="2" face="arial,helvetica">REG_DWORD</font></td>
                <td valign="top"><font size="2" face="arial,helvetica"><b><font color="#00008b" face="courier new,courier,monospace,arial,helvetica">0x00000010 (16)</font> </b></font></td>
            </tr>
        </tbody>
    </table>
    </li>
</ul>
<p>&nbsp;原文：<a href="https://wwwnew.towson.edu/knowledgecenter/article.aspx?article=74">https://wwwnew.towson.edu/knowledgecenter/article.aspx?article=74</a><br />
参考 <a href="http://www.s-w-r.com/news_appendix.html">http://www.s-w-r.com/news_appendix.html</a><br />
<a href="http://www.petri.co.il/forums/showthread.php?t=3836">http://www.petri.co.il/forums/showthread.php?t=3836</a></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.anywolfs.com/liuhui/article.asp?id=419" /> 
	  <id>http://www.anywolfs.com/liuhui/default.asp?id=419</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[netsh ipsec 的应用]]></title>
	  <author>
		 <name>jothui</name>
		 <uri>http://www.anywolfs.com/liuhui/</uri>
		 <email>jothui8@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://www.anywolfs.com/liuhui/default.asp?cateID=4" label="Security" /> 
	  <updated>2009-04-29T10:39:00+08:00</updated>
	  <published>2009-04-29T10:39:00+08:00</published>
		  <summary type="html"><![CDATA[<h2 class="heading">Netsh ipsec 的应用（用于 Internet 协议安全的 Netsh 命令）</h2>
<div id="mainSection">
<div id="mainBody">
<h2 class="heading">用于 Internet 协议安全性 (IPSec) 的 Netsh 命令</h2>
<div id="sectionSection0" class="section">
<p>在 Microsoft 管理控制台 (MMC) 中可以获得&ldquo;IP 安全策略管理&rdquo;和&ldquo;IP 安全监视器&rdquo;管理单元，而 Internet 协议安全性 (IPSec) 的 Netsh 命令则提供了等价于由这两个管理单元提供的基于控制台的管理和诊断功能。通过使用用于 IPSec 的 Netsh 命令，可以配置和查看静态或动态的 IPSec 主模式设置、快速模式设置、规则和配置参数。</p>
<p>尤其有以下需要时，通过命令行管理 IPSec 非常有用：</p>
<ul>
    <li>编写 IPSec 配置脚本。<br />
    <br />
    &nbsp;</li>
    <li>通过配置下列功能来扩展 IPSec 的安全性和可管理性，而这些功能是&ldquo;IP 安全策略管理&rdquo;管理单元所不具备的：IPSec 诊断、默认的通讯免除、证书吊销列表 (CRL) 强制检测、IKE (Oakley) 日志记录、日志记录间隔、计算机启动安全以及计算机启动通讯免除。 <br />
    &nbsp;</li>
</ul>
<p>可以从 Windows&nbsp;Server&trade;&nbsp;2003 家族产品的命令提示符下，或 <strong>netsh ipsec</strong> 环境的命令提示符下运行这些命令。对于在 Windows&nbsp;Server&trade;&nbsp;2003 家族产品命令提示符下运行的这些命令，必须先键入 <strong>netsh ipsec</strong>，然后再按照下面的语法键入命令和参数。</p>
</div>
<h2 class="heading">Netsh ipsec static 模式命令</h2>
<div id="sectionSection1" class="section">
<p>使用 <strong>netsh ipsec static</strong> 命令，可以执行通过使用&ldquo;IP 安全策略管理&rdquo;和&ldquo;IP 安全监视器&rdquo;控制台所能执行的管理和监视任务。通过使用这些命令，可以创建、修改和指派 IPSec 策略，而不会立即影响活动 IPSec 策略的配置。</p>
</div>
<h2 class="heading">Netsh ipsec dynamic 模式命令</h2>
<div id="sectionSection2" class="section">
<p>可以使用 <strong>netsh ipsec dynamic</strong> 命令来显示 IPSec 的活动状态，并立即影响活动 IPsec 策略的配置。这些命令直接配置安全策略数据库 (SPD)。只有当 IPSec 服务正在运行时，使用这些命令对 IPSec 策略进行的更改才能生效。如果 IPSec 服务停止，将放弃动态策略设置。尽管这些命令中的大多数会立即生效，但仍有几个配置命令需要在重新启动 IPSec 服务或重新启动计算机之后才能生效。有关这些命令的详细信息，请参阅 <strong>netsh ipsec dynamic set config</strong> 命令的语法描述。</p>
<p><strong>警告</strong></p>
<ul>
    <li>由于 IPSec 策略代理不会解释 <strong>netsh ipsec dynamic</strong> 命令，所以必须掌握如何应用 IKE 主模式和快速模式策略，才能有效地使用这些命令。使用这些命令时应当谨慎，因为有可能即使创建了无效的 IPSec 策略配置却不会遇到警告。<br />
    &nbsp;</li>
</ul>
<p><strong>注意</strong></p>
<ul>
    <li>IPSec 的 Netsh 命令只能用来在运行 Windows&nbsp;Server&trade;&nbsp;2003 家族产品成员的计算机上配置 IPSec 策略。 <br />
    <br />
    要使用命令行来配置运行 Windows&nbsp;XP 的计算机上的 IPSec 策略，请使用 Ipseccmd.exe（该工具在 Windows&nbsp;XP CD 内的 \Support\Tools 文件夹中）。要使用命令行来配置运行 Windows 2000 的计算机上的 IPSec 策略，请使用 Ipsecpol.exe（该工具在&ldquo;Windows 2000 Server 资源工具包&rdquo;中）。<br />
    <br />
    &nbsp;</li>
    <li>有关 <strong>netsh</strong> 的详细信息，请参阅 <a id="ctl00_mainContentContainer_ctl01" onclick="javascript:Track('ctl00_mainContentContainer_ctl00|ctl00_mainContentContainer_ctl01',this);" href="http://technet.microsoft.com/zh-cn/library/cc778925.aspx"><font color="#800080">Netsh 概述</font></a>和<a id="ctl00_mainContentContainer_ctl02" onclick="javascript:Track('ctl00_mainContentContainer_ctl00|ctl00_mainContentContainer_ctl02',this);" href="http://technet.microsoft.com/zh-cn/library/cc787249.aspx"><font color="#0033cc">输入 netsh 上下文</font></a>。<br />
    &nbsp;</li>
    <li>有关 Netsh 命令的详细信息，请参阅 <a id="ctl00_mainContentContainer_ctl03" onclick="javascript:Track('ctl00_mainContentContainer_ctl00|ctl00_mainContentContainer_ctl03',this);" href="http://technet.microsoft.com/zh-cn/library/cc785383.aspx"><font color="#800080">Netsh 命令行实用程序</font></a>。<br />
    &nbsp;</li>
</ul>
</div>
<h2 class="heading">Netsh ipsec</h2>
<div id="sectionSection3" class="section">
<p>下列命令可在 <strong>ipsec</strong>&gt; 提示符下使用，该提示符在 netsh 上下文中是根级提示符。</p>
<p><strong>注意</strong></p>
<ul>
    <li>尽管 <strong>dump</strong> 命令在 <strong>ipsec</strong>&gt; 提示符下可用，但它是无效的。<br />
    &nbsp;</li>
</ul>
<p>若要查看该命令语法，请单击以下命令：</p>
<ul>
    <li><font color="#0033cc">static</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">dynamic</font><br />
    <br />
    &nbsp;</li>
</ul>
<div class="subSection">
<h4 class="subHeading">static</h4>
<div class="subSection">
<p>切换到静态环境。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>static</strong></p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection">
<p>无</p>
</div>
</div>
<h4 class="subHeading">dynamic</h4>
<div class="subSection">
<p>切换到动态上下文。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>dynamic</strong></p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection">
<p>无</p>
</div>
</div>
</div>
</div>
<h2 class="heading">Netsh ipsec static</h2>
<div id="sectionSection4" class="section">
<p>下列命令可在 <strong>ipsec static</strong>&gt; 提示符下使用，该提示符在 netsh 上下文中为根级提示符。</p>
<p>若要查看该命令语法，请单击以下命令：</p>
<ul>
    <li><font color="#0033cc">add filter</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">add filteraction</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">add filterlist</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">add policy</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">add rule</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">delete all</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">delete filter</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">delete filteraction</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">delete filterlist</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">delete policy</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">delete rule</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">exportpolicy</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">importpolicy</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">restorepolicyexamples</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">set defaultrule</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">set filteraction</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">set filterlist</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">set policy</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">set rule</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">set store</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show all</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show filteraction</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show filterlist</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show gpoassignedpolicy</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show policy</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show rule</font><br />
    <br />
    &nbsp;</li>
</ul>
<div class="subSection">
<h4 class="subHeading">add filter</h4>
<div class="subSection">
<p>添加筛选器到指定的筛选器列表。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>add filter </strong><strong>filterlist=</strong><strong>srcaddr=</strong><strong>dstaddr=</strong> [<strong>description=</strong>][<strong>protocol=</strong>][<strong>mirrored=</strong>] [<strong>srcmask=</strong>][<strong>dstmask=</strong>][<strong>srcport=</strong>] [<strong>dstport=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>filterlist=</strong><em>字符串</em></strong> </dt><dd>必需。指定要向其中添加筛选器的筛选器列表的名称。每个筛选器定义了一组要保护的入站或出站网络通讯。</dd></dl><dl><dt><strong><strong>srcaddr=</strong>{ <strong>Me</strong>| <strong>Any</strong>| <em>IPAddress</em>| <em>DNSName</em>| <em>ServerType</em>} </strong></dt><dd>必需。指定 IP 通讯的源 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong><strong>dstaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> |<em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>} </strong></dt><dd>必需。指定 IP 通讯的目标 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong>[ <strong>description=</strong><em>字符串</em>] </strong></dt><dd>提供有关 IP 筛选器的信息。</dd></dl><dl><dt><strong>[ <strong>protocol=</strong>{<strong>ANY</strong> | <strong>ICMP</strong> |<strong>TCP</strong>| <strong>UDP</strong> | <strong>RAW</strong> | <em>Integer </em>}] </strong></dt><dd>指定 IP 协议（除了寻址信息以外，如果要筛选特定的 IP 协议）。默认值为 <strong>ANY</strong>，表示该筛选器可以使用所有协议。</dd></dl><dl><dt><strong>[ <strong>mirrored=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定是否创建镜像筛选器。使用 <strong>yes</strong> 可以基于筛选器设置创建两个筛选器，一个用于到目标的通讯，一个用于来自目标的通讯。默认值为 <strong>yes</strong>。</dd></dl><dl><dt><strong>[ <strong>srcmask=</strong>{<em>Mask</em> | <em>Prefix</em>}] </strong></dt><dd>指定将被筛选的数据包源地址子网掩码或前缀。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>dstmask=</strong>{<em>Mask</em> | <em>Prefix</em>} </strong></dt><dd>指定将被筛选的数据包目标地址子网掩码或前缀值。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>srcport=</strong><em>Port</em>] </strong></dt><dd>指定将被筛选的数据包的源端口号。该选项仅适用于筛选 TCP 或 UDP 数据包。如果指定为 0，则来自任何端口的数据包都将被筛选。默认设置为任意值。</dd></dl><dl><dt><strong>[ <strong>dstport=</strong><em>Port</em>] </strong></dt><dd>指定将被筛选的数据包的目标端口号。该选项仅适用于筛选 TCP 或 UDP 数据包。如果指定为 0，则发送到任何端口的数据包都将被筛选。默认设置为任意值。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>如果筛选器列表不存在，则创建此列表。<br />
    <br />
    &nbsp;</li>
    <li>不要创建名称为 <strong>all</strong> 的筛选器列表。这样做会与选择所有 IPSec 筛选器列表的 <strong>netsh ipsec</strong> 选项（例如 <strong>delete filterlist all</strong>）产生冲突。<br />
    <br />
    &nbsp;</li>
    <li>要筛选进出特定计算机的任何数据包，可以使用 <strong>srcaddr=Me</strong> 或 <strong>dstaddr=Me</strong>。<br />
    <br />
    &nbsp;</li>
    <li>要筛选进出任何计算机的数据包，可以使用 <strong>srcaddr=Any</strong> 或 <strong>dstaddr=Any</strong>。 <br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">add filteraction</h4>
<div class="subSection">
<p>创建一个具有指定的快速模式安全措施的筛选器操作。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>add filteraction</strong><strong>name=</strong> [<strong>description=</strong>][<strong>qmpfs=</strong>][<strong>inpass=</strong>] [<strong>soft=</strong>][<strong>action=</strong>][<strong>qmsecmethods=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em></strong> </dt><dd>必需。指定要创建的筛选器操作的名称。</dd></dl><dl><dt><strong>[ <strong>description=</strong><em>字符串</em>] </strong></dt><dd>提供有关筛选器操作的信息。</dd></dl><dl><dt><strong>[ <strong>qmpfs=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定是否启用会话密钥完全向前保密 (PFS)。如果指定 <strong>yes</strong>，则每当要求新的会话密钥时都需要重新协商新的主密钥材料。默认值为 <strong>no</strong>。</dd></dl><dl><dt><strong>[ <strong>inpass=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定是否允许与配置的筛选器列表匹配的传入数据包不采取安全措施，但是要求答复时提供采取安全措施的 IPSec 通讯。默认值为 <strong>no</strong>。</dd></dl><dl><dt><strong>[ <strong>soft=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定当其他计算机不支持 IPSec 时，或者与具有 IPSec 功能的计算机进行 IPSec 协商失败时，是否重新使用不安全的通讯。默认值为 <strong>no</strong>。</dd></dl><dl><dt><strong>[ <strong>action=</strong>{<strong>permit</strong> | <strong>block</strong> | <strong>negotiate</strong>}] </strong></dt><dd>指定是否允许通讯而不协商 IP 安全性。如果指定 <strong>permit</strong>，则可在不协商或不应用 IP 安全的情况下，传输或接收通讯。如果指定 <strong>block</strong>，则通讯将被阻止。如果指定 <strong>negotiate</strong>，则将使用带有指定安全措施列表的 IP 安全。默认值为 <strong>negotiate</strong>。</dd></dl><dl><dt><strong>[ <strong>qmsecmethods=&quot;</strong><em>Neg1Neg2</em><strong>&quot;</strong>] </strong></dt><dd>指定由空格分隔并按以下格式定义的一个或多个安全措施： {<strong>ESP</strong> [<em>ConfAlg</em>,<em>AuthAlg</em>]<strong>:</strong><em>k</em>/<em>s</em> | <strong>AH</strong> [<em>HashAlg</em>]<strong>:</strong><em>k/s</em> | <strong>AH</strong> [<em>HashAlg</em>+<strong>ESP</strong><em>ConfAlg</em>,<em>AuthAlg</em>]<strong>:</strong><em>k</em>/<em>s</em>}] 其中： <dl><dt><strong><em>ConfAlg</em></strong> </dt><dd>指定加密算法。<em>ConfigAlg</em> 可以是 <strong>DES</strong>（数据加密标准）、<strong>3DES</strong> 或<strong>无</strong>。 </dd></dl><dl><dt><strong><em>AuthAlg</em></strong> </dt><dd>指定完整性算法。<em>AuthAlg</em> 可以是 <strong>MD5</strong>（消息摘要 5）、<strong>SHA1</strong>（安全哈希算法 1）或<strong>无</strong>。</dd></dl><dl><dt><strong><em>HashAlg</em></strong> </dt><dd>指定哈希函数。<em>HashAlg</em> 可以是 <strong>MD5</strong>（消息摘要 5）或 <strong>SHA1</strong>。</dd></dl><dl><dt><strong><em>k</em></strong> </dt><dd>指定以千字节为单位的会话密钥生命周期。传输了指定千字节的数据后，会为快速模式 SA 生成新的会话密钥。默认值为 100000 千字节。</dd></dl><dl><dt><strong><em>s</em></strong> </dt><dd>指定以秒为单位的会话密钥生命周期。默认值是 3600 秒。</dd></dl></dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>不要创建名为 <strong>all</strong> 的筛选器操作。这样做会与选择所有 IPSec 筛选器操作的 <strong>netsh ipsec</strong> 选项（例如 <strong>delete filteraction all</strong>）产生冲突。<br />
    <br />
    &nbsp;</li>
    <li>如果指定了 <strong>action=permit</strong> 或 <strong>action=block</strong>，并且指定了 <strong>qmsecmethods</strong> 参数，将不使用 <strong>qmsecmethods</strong> 参数。此外，如果指定了 <strong>qmpfs=yes</strong>、<strong>inpass=yes</strong> 或 <strong>soft=yes</strong>，也不会使用这些参数。<br />
    <br />
    &nbsp;</li>
    <li>启动会话密钥的重新生成基于首先到达的时间间隔（秒或千字节）。如果未配置新间隔，则将使用默认间隔。<br />
    <br />
    &nbsp;</li>
    <li>如果未指定 <strong>qmsecmethods=</strong>（快速模式安全措施），则将使用以下默认值： <br />
    <br />
    <ul>
        <li>ESP [3DES, SHA1]:100000k/3600s<br />
        <br />
        &nbsp;</li>
        <li>ESP [3DES, MD5]:100000k/3600s<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>在命令中指定的每个快速模式安全措施的顺序决定了该安全措施的首选顺序。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">add filterlist</h4>
<div class="subSection">
<p>创建具有指定名称的空筛选器列表。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>add filterlist</strong><strong>name=</strong> [<strong>description=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em></strong> </dt><dd>必需。指定要创建的筛选器列表的名称。</dd></dl><dl><dt><strong>[ <strong>description=</strong><em>字符串</em>] </strong></dt><dd>提供有关筛选器列表的信息。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>不要创建名称为 <strong>all</strong> 的筛选器列表。这样做会与选择所有 IPSec 筛选器列表的 <strong>netsh ipsec</strong> 选项（例如 <strong>delete filterlist all</strong>）产生冲突。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">add policy</h4>
<div class="subSection">
<p>创建具有指定名称的 IPSec 策略。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>add policy</strong><strong>name=</strong> [<strong>description=</strong>][<strong>mmpfs=</strong>][<strong>qmpermm=</strong>] [<strong>mmlifetime=</strong>][<strong>activatedefaultrule=</strong>][<strong>pollinginterval=</strong>][<strong>assign=</strong>][<strong>mmsecmethods=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em></strong> </dt><dd>必需。指定要创建的 IPSec 策略的名称。</dd></dl><dl><dt><strong>[ <strong>description=</strong><em>字符串</em>] </strong></dt><dd>提供有关 IPSec 策略的信息。</dd></dl><dl><dt><strong>[ <strong>mmpfs=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定是否启用主密钥完全向前保密 (PFS)。如果指定 <strong>yes</strong>，则主模式安全 SA 将被重新验证，而且每当要求提供快速模式 SA 的会话密钥材料时都需要协商新的主密钥的密钥材料。默认值为 <strong>no</strong>。</dd></dl><dl><dt><strong>[ <strong>qmpermm=</strong><em>Integer</em>] </strong></dt><dd>指定主密钥材料可用来派生会话密钥的次数。默认值为 0，这意味着可以从主模式 SA 派生出无限多个快速模式 SA。</dd></dl><dl><dt><strong>[ <strong>mmlifetime=</strong><em>Integer</em>] </strong></dt><dd>指定生成新主密钥所需的分钟数。默认值为 480 分钟。</dd></dl><dl><dt><strong>[ <strong>activatedefaultrule=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定是否为该 IPSec 策略激活默认响应规则。默认设置为 <strong>yes</strong>。</dd></dl><dl><dt><strong>[ <strong>pollinginterval=</strong><em>Integer</em>] </strong></dt><dd>指定为了解该策略的变化而进行轮询的频率。默认值为 180 分钟。</dd></dl><dl><dt><strong>[ <strong>assign=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定是否指派该 IPSec 策略（只能指派一个 IPSec 策略）。默认值是 <strong>no</strong>。 </dd></dl><dl><dt><strong>[ <strong>mmsecmethods=&quot;</strong><em>SecMeth1SecMeth2</em><strong>&quot;</strong>] </strong></dt><dd>指定由空格分隔并按以下格式定义的一个或多个密钥交换安全措施：<em>ConfAlg</em>-<em>HashAlg</em>-<em>GroupNumb</em>，其中： <dl><dt><strong><em>ConfAlg</em></strong> </dt><dd>指定加密算法。<em>ConfAlg</em> 可以是 <strong>DES</strong>（数据加密标准）或 <strong>3DES</strong>。</dd></dl><dl><dt><strong><em>HashAlg</em></strong> </dt><dd>指定哈希函数。<em>HashAlg</em> 可以是 <strong>MD5</strong>（消息摘要 5）或 <strong>SHA1</strong>（安全哈希算法 1）。</dd></dl><dl><dt><strong><em>GroupNum</em></strong> </dt><dd>指定用于基本密钥材料的 Diffie-Hellman 组。<em>GroupNumb</em> 可以为：<strong>1</strong>（低，使用 768 位密钥材料保护），<strong>2</strong>（中等，使用 1024 位保护）以及 <strong>3</strong>（高，使用 2048 位保护）。 </dd></dl></dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>不要创建名为 <strong>all</strong> 的策略。这样做可能会与 <strong>netsh ipsec</strong> 选项产生冲突，因为它会选择所有 IPSec 策略（例如 <strong>delete policy all</strong>）。<br />
    <br />
    &nbsp;</li>
    <li>由于只能指派一个 IPSec 策略，如果当前已指派了策略并指派了新的策略，则当前指派的策略将自动解除指派。 <br />
    <br />
    &nbsp;</li>
    <li>如果指定了 <strong>set store=domain</strong>（当 IPSec 策略存储在 Active Directory 中时），则 <strong>assign</strong> 将无效。要为组策略对象指派策略，必须先使用 <strong>add policy</strong> 命令创建策略，然后使用 <strong>set store</strong> 命令。<br />
    <br />
    &nbsp;</li>
    <li>如果指定 <strong>mmpfs=yes</strong>（启用主密钥 PFS），则 <strong>qmperm</strong> 的默认设置为 1 且不可配置，因为每一个新会话都将使主密钥的密钥材料被重新协商。<br />
    <br />
    &nbsp;</li>
    <li>如果未指定 <strong>mmsecmethods=</strong>（密钥交换安全措施），则使用如下默认值： <br />
    <br />
    <ul>
        <li>3DES-SHA1-2<br />
        <br />
        &nbsp;</li>
        <li>3DES-MD5-2<br />
        <br />
        &nbsp;</li>
        <li>3DES-SHA1-3<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>IPSec 双方都必须具有至少一个通用的密钥交换安全措施（使用相同设置的措施），否则协商将会失败。 <br />
    <br />
    &nbsp;</li>
    <li>在主模式生存期内，如果快速模式协商数超过按照主模式协商为快速模式协商数设置的值，将发生新的主模式协商。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">add rule</h4>
<div class="subSection">
<p>用指定的身份验证方法，创建一个链接指定 IPSec 策略、筛选器列表和筛选器操作的规则。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>add rule</strong><strong>name=</strong><strong>policy=</strong><strong>filterlist=</strong><strong>filteraction=</strong>[<strong>tunnel=</strong>][<strong>conntype=</strong>] [<strong>activate=</strong>][<strong>description=</strong>][<strong>kerberos=</strong>][<strong>psk=</strong>][<strong>rootca=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em></strong> </dt><dd>必需。指定要创建的 IPSec 策略的名称。</dd></dl><dl><dt><strong><strong>policy=</strong><em>字符串</em></strong> </dt><dd>必需。指定包含该规则的 IPSec 策略的名称。</dd></dl><dl><dt><strong><strong>filterlist=</strong><em>字符串</em></strong> </dt><dd>必需。指定适用于该规则的 IP 筛选器列表的名称。</dd></dl><dl><dt><strong><strong>filteraction=</strong><em>字符串</em></strong> </dt><dd>必需。指定适用于该规则的 IP 筛选器操作的名称。</dd></dl><dl><dt><strong>[ <strong>tunnel=</strong>{<em>IPAddress</em> | <em>DNSName</em>}] </strong></dt><dd>为隧道模式指定隧道端点的 IP 地址或 DNS 名称。默认情况下，没有指定该选项并且使用传输模式。</dd></dl><dl><dt><strong>[ <strong>conntype=</strong>{<strong>lan</strong> | <strong>dialup</strong> | <strong>all</strong>}] </strong></dt><dd>指定该规则是仅应用于远程访问、拨号连接或局域网 (LAN) 连接，还是应用于所有连接。默认值为 <strong>all</strong>。</dd></dl><dl><dt><strong>[ <strong>activate=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定是否为指定的 IPSec 策略激活该规则。默认设置为 <strong>yes</strong>。</dd></dl><dl><dt><strong>[ <strong>description=</strong><em>字符串</em>] </strong></dt><dd>提供有关该规则的信息。</dd></dl><dl><dt><strong>[ <strong>kerberos=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定是否将 Kerberos V5 协议作为身份验证方法。</dd></dl><dl><dt><strong>[ <strong>psk=</strong><em>字符串</em>] </strong></dt><dd>如果将预共享的密钥作为身份验证方法，则指定用于该预共享密钥的字符串。</dd></dl><dl><dt><strong>[ <strong>rootca=&quot;</strong><em>String</em><strong>certmap:</strong>{<strong>yes</strong>| <strong>no</strong>} <strong>excludecaname:</strong>{<strong>yes</strong>| <strong>no</strong>} <strong>&quot;</strong>] </strong></dt><dd>指定证书身份验证选项，其中： <dl><dt><strong><em>String </em></strong></dt><dd>如果将证书作为身份验证方法，则指定该证书的可分辨名称。</dd></dl><dl><dt><strong><strong>certmap:</strong>{<strong>yes</strong>|<strong>no</strong>} </strong></dt><dd>指定是否启用证书到帐户的映射。可以启用证书到帐户映射，以验证证书是否正在被受信任的计算机使用。</dd></dl><dl><dt><strong><strong>excludecaname:</strong>{<strong>yes</strong>|<strong>no</strong>} </strong></dt><dd>指定是否从证书申请中排除受信任的根 CA 名称列表（从中接受证书）。 </dd></dl></dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>不要创建名为 <strong>all</strong> 的规则。这样做会与选择所有 IPSec 规则的 <strong>netsh ipsec</strong> 选项（例如 <strong>delete rule all</strong>）产生冲突。<br />
    <br />
    &nbsp;</li>
    <li>对于作为 Active Directory 域成员的计算机，只能使用 Kerberos V5 身份验证或证书到帐户的映射。<br />
    <br />
    &nbsp;</li>
    <li>尽管只能使用一个预共享的密钥进行身份验证，但是如果为每个要使用的证书都指定一次 <strong>rootca</strong> 参数，则可以使用多个证书。<br />
    <br />
    &nbsp;</li>
    <li>所有的证书身份验证参数都必须包含在引号中。嵌入式引号标记必须用后面跟撇号的反斜杠替换 (\')。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
    <li>在命令中为每个身份验证方法指定的顺序决定了该方法的首选顺序。<br />
    <br />
    &nbsp;</li>
    <li>如果未指定身份验证方法，则使用动态的默认值。默认情况下，IPSec 策略使用 Kerberos V5 身份验证。如果该计算机具有计算机证书，则与该计算机证书链接的任意根 CA 也可用作身份验证。<br />
    <br />
    &nbsp;</li>
    <li>如果指定了 <strong>excludecaname:yes</strong>，则受信任的根 CA 的列表不作为证书申请的一部分被发送，从而杜绝了有关计算机信任关系的敏感信息泄漏的可能性。要增强连接到 Internet 的计算机的安全性，请指定该选项。<br />
    <br />
    &nbsp;</li>
    <li>不推荐使用预共享密钥身份验证方法，因为相对来说它是一种比较弱的身份验证方法。此外，预共享密钥以明文方式存储。<br />
    <br />
    &nbsp;</li>
    <li>IPSec 双方都必须有至少一个通用身份验证方法，否则通讯将失败。 <br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">delete all</h4>
<div class="subSection">
<p>删除所有的 IPSec 策略、筛选器列表和筛选器操作。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>delete all</strong></p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection">
<p>无。</p>
</div>
</div>
<h4 class="subHeading">delete filter</h4>
<div class="subSection">
<p>从与指定参数相匹配的筛选器列表中删除筛选器。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>delete filter </strong><strong>filterlist=</strong><strong>srcaddr=</strong><strong>dstaddr=</strong>[<strong>protocol=</strong>] [<strong>srcmask=</strong>][<strong>dstmask=</strong>][<strong>srcport=</strong>] [<strong>dstport=</strong>][<strong>mirrored=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>filterlist=</strong><em>字符串</em></strong> </dt><dd>必需。指定向其中添加筛选器的筛选器列表的名称。</dd></dl><dl><dt><strong><strong>srcaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> | <em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>} </strong></dt><dd>必需。指定被匹配的 IP 通讯的源 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong><strong>dstaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> |<em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>} </strong></dt><dd>必需。指定当前匹配的 IP 通讯的目标 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong>[ <strong>protocol=</strong>{<strong>ANY</strong> | <strong>ICMP</strong> |<strong>TCP</strong>| <strong>UDP</strong> | <strong>RAW</strong> | <em>Integer </em>}] </strong></dt><dd>除了寻址信息外，如果筛选某个特定的 IP 协议，则指定该 IP 协议。值为 <strong>ANY</strong> 表示与协议设置为 <strong>any</strong> 的筛选器匹配。</dd></dl><dl><dt><strong>[ <strong>srcmask=</strong>{<em>Mask</em> | <em>Prefix</em>}] </strong></dt><dd>指定当前被筛选数据包的源地址子网掩码或前缀。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>dstmask=</strong>{<em>Mask</em> | <em>Prefix</em>}] </strong></dt><dd>指定当前被筛选数据包的目标地址子网掩码或前缀值。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>srcport=</strong><em>Port</em>] </strong></dt><dd>指定当前被筛选数据包的源端口号。该选项仅适用于筛选 TCP 或 UDP 数据包。值为 <strong>0</strong> 表示与源端口设置为 <strong>any</strong> 的筛选器匹配。 </dd></dl><dl><dt><strong>[ <strong>dstport=</strong><em>Port</em>] </strong></dt><dd>指定当前被筛选数据包的目标端口号。该选项仅适用于筛选 TCP 或 UDP 数据包。值为 <strong>0</strong> 表示与目标端口设置为 <strong>any</strong> 的筛选器匹配。</dd></dl><dl><dt><strong>[ <strong>mirrored=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定是否创建镜像筛选器。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>该命令只删除与所指定的参数完整匹配的筛选器。<br />
    <br />
    &nbsp;</li>
    <li>如果没有指定可选参数，则会删除与指定的（必需）参数相匹配的所有筛选器。<br />
    <br />
    &nbsp;</li>
    <li>要将筛选进出计算机的任何数据包的筛选器删除，可以使用 <strong>srcaddr=Me</strong> 或 <strong>dstaddr=Me</strong>。<br />
    <br />
    &nbsp;</li>
    <li>要将筛选进出任何计算机的数据包的筛选器删除，可以使用 <strong>srcaddr=Any</strong> 或 <strong>dstaddr=Any</strong>。 <br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">delete filteraction</h4>
<div class="subSection">
<p>删除指定的筛选器操作或所有筛选器操作。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>delete filteraction</strong><strong>name=</strong> | <strong>all</strong></p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>all</strong></strong> </dt><dd>必需。指定要删除的筛选操作的名称。或者，如果指定 <strong>all</strong>，则删除所有筛选操作。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">delete filterlist</h4>
<div class="subSection">
<p>删除指定的筛选器列表或所有筛选器列表。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>delete filterlist</strong><strong>name=</strong> | <strong>all</strong></p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>all</strong></strong> </dt><dd>必需。指定要删除的筛选器列表的名称。或者，如果指定 <strong>all</strong>，则删除所有筛选器列表。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">delete policy</h4>
<div class="subSection">
<p>删除指定的 IPSec 策略及所有关联规则，或所有 IPSec 策略。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>delete policy</strong><strong>name=</strong> | <strong>all</strong></p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>all</strong></strong> </dt><dd>必需。指定要删除的 IPSec 策略的名称。或者，如果指定 <strong>all</strong>，则删除所有 IPSec 策略。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">delete rule</h4>
<div class="subSection">
<p>从指定的 IPSec 策略中删除指定的规则或所有规则。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>delete rule</strong><strong>name=</strong> | <strong>ID=</strong> | <strong>allpolicy=</strong></p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>ID=</strong><em>Integer</em>| <strong>all</strong></strong> </dt><dd>必需。指定要删除的规则。如果指定了规则名称或规则 ID（用来标识规则在策略规则列表中的位置的编号），则删除相应的规则。如果指定了 <strong>all</strong>，则删除所有规则。</dd></dl><dl><dt><strong><strong>policy=</strong><em>字符串</em></strong> </dt><dd>必需。指定从中删除一个或多个规则的策略的名称。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>不能删除默认的响应规则。<br />
    <br />
    &nbsp;</li>
    <li>删除规则后，剩余规则的所有 ID 将相应发生更改。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">exportpolicy</h4>
<div class="subSection">
<p>将所有 IPSec 策略信息导出到指定的文件。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>exportpolicy</strong><strong>file=</strong></p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>file=</strong><em>字符串</em></strong> </dt><dd>必需。指定将 IPSec 策略信息导出到其中的文件的名称。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>默认情况下，当 IPSec 策略被导入文件时，该文件名称将添加 .ipsec 扩展名。<br />
    <br />
    &nbsp;</li>
    <li>为增强混合环境中运行 Windows 2000 的计算机之间的互操作性，请将用于保存策略信息的文件的名称限制在 60 个字符以内。 <br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">importpolicy</h4>
<div class="subSection">
<p>从指定的 IPSec 文件导入所有的 IPSec 策略信息。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>importpolicy</strong><strong>file=</strong></p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>file=</strong><em>字符串</em></strong> </dt><dd>必需。指定从中导入 IPSec 策略信息的文件的名称。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">restorepolicyexamples</h4>
<div class="subSection">
<p>恢复默认的 IPSec 策略。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>restorepolicyexamples</strong><strong>release=</strong></p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>release=</strong>{ <strong>win2K</strong>| <strong>Win2003</strong>} </strong></dt><dd>必需。指定当前所还原的默认 IPSec 策略的版本。如果指定了 <strong>win2K</strong>，将还原 Windows 2000 附带的默认 IPSec 策略。如果指定了 <strong>Win2003</strong>，将还原 Windows&nbsp;Server&trade;&nbsp;2003 家族产品附带的默认 IPSec 策略。 </dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>还原默认的 IPSec 策略，将覆盖对原始默认策略、筛选器列表和筛选器操作的所有更改，即使这些配置项的名称已经更改也是如此。如果已经修改了这些项并且不想让修改被覆盖，则不要还原默认策略。<br />
    <br />
    &nbsp;</li>
    <li>只能还原基于计算机的 IPSec 策略的默认 IPSec 策略。不能还原 Active Directory 中 IPSec 策略的默认 IPSec 策略。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">set defaultrule</h4>
<div class="subSection">
<p>修改指定策略的默认响应规则。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>set defaultrule</strong><strong>policy=</strong>[<strong>qmpfs=</strong>][<strong>activate=</strong>] [<strong>qmsecmethods=</strong>][<strong>kerberos=</strong>][<strong>psk=</strong>][<strong>rootca=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>policy=</strong><em>字符串</em></strong> </dt><dd>必需。指定其默认响应规则已被修改的 IPSec 策略的名称。</dd></dl><dl><dt><strong>[ <strong>qmpfs=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定是否启用会话密钥完全向前保密 (PFS)。如果指定 <strong>yes</strong>，则每当要求新的会话密钥时都需要重新协商新的主密钥材料。默认值为 <strong>no</strong>。</dd></dl><dl><dt><strong>[ <strong>activate=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定是否为指定的 IPSec 策略激活该规则。默认设置为 <strong>yes</strong>。</dd></dl><dl><dt><strong>[ <strong>qmsecmethods=&quot;</strong><em>Neg1Neg2</em><strong>&quot;</strong>] </strong></dt><dd>指定由空格分隔并按以下格式定义的一个或多个安全措施： {<strong>ESP</strong> [<em>ConfAlg</em><strong>,</strong><em>AuthAlg</em>]<strong>:</strong><em>k</em><strong>/</strong><em>s</em> | <strong>AH</strong> [<em>HashAlg</em>]<strong>:</strong><em>k</em><strong>/</strong><em>s</em> | <strong>AH</strong> [<em>HashAlg</em><strong>+ESP</strong><em>ConfAlg</em><strong>,</strong><em>AuthAlg</em>]<strong>:</strong><em>k</em><strong>/</strong><em>s</em>}] 其中： <dl><dt><strong><em>ConfAlg</em></strong> </dt><dd>指定加密算法。<em>ConfigAlg</em> 可以是 <strong>DES</strong>（数据加密标准）、<strong>3DES</strong> 或<strong>无</strong>。 </dd></dl><dl><dt><strong><em>AuthAlg</em></strong> </dt><dd>指定完整性算法。<em>AuthAlg</em> 可以是 <strong>MD5</strong>（消息摘要 5）、<strong>SHA1</strong>（安全哈希算法 1）或<strong>无</strong>。</dd></dl><dl><dt><strong><em>HashAlg</em></strong> </dt><dd>指定哈希函数。<em>HashAlg</em> 可以是 <strong>MD5</strong>（消息摘要 5）或 <strong>SHA1</strong>。</dd></dl><dl><dt><strong><em>k</em></strong> </dt><dd>指定以千字节为单位的会话密钥生命周期。传输了指定千字节的数据后，会为快速模式 SA 生成新的会话密钥。默认值为 100,000 千字节。</dd></dl><dl><dt><strong><em>s</em></strong> </dt><dd>指定以秒为单位的会话密钥生命周期。默认值是 3600 秒。</dd></dl></dd></dl><dl><dt><strong>[ <strong>kerberos=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定是否将 Kerberos V5 协议作为身份验证方法。</dd></dl><dl><dt><strong>[ <strong>psk=</strong><em>字符串</em>] </strong></dt><dd>如果将预共享的密钥作为身份验证方法，则指定用于该预共享密钥的字符串。</dd></dl><dl><dt><strong>[ <strong>rootca=&quot;</strong><em>String</em><strong>certmap:</strong>{<strong>yes</strong>| <strong>no</strong>} <strong>excludecaname:</strong>{<strong>yes</strong>| <strong>no</strong>} <strong>&quot;</strong>] </strong></dt><dd>指定证书身份验证选项，其中： <dl><dt><strong><em>String </em></strong></dt><dd>如果将证书作为身份验证方法，则指定该证书的可分辨名称。 </dd></dl><dl><dt><strong><strong>certmap:</strong>{<strong>yes</strong>|<strong>no</strong>} </strong></dt><dd>指定是否启用证书到帐户的映射。可以启用证书到帐户映射，以验证证书是否正在被受信任的计算机使用。</dd></dl><dl><dt><strong><strong>excludecaname:</strong>{<strong>yes</strong>|<strong>no</strong>} </strong></dt><dd>指定是否从证书申请中排除受信任的根 CA 名称列表（从中接受证书）。 </dd></dl></dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>对于作为 Active Directory 域成员的计算机，只能使用 Kerberos V5 身份验证或证书到帐户的映射。<br />
    <br />
    &nbsp;</li>
    <li>尽管只能使用一个预共享的密钥进行身份验证，但是如果为每个要使用的证书都指定一次 <strong>rootca</strong> 参数，则可以使用多个证书。<br />
    <br />
    &nbsp;</li>
    <li>所有的证书身份验证参数都必须包含在引号中。嵌入式引号标记必须用后面跟撇号的反斜杠替换 (\')。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
    <li>在命令中为每个身份验证方法指定的顺序决定了该方法的首选顺序。<br />
    <br />
    &nbsp;</li>
    <li>如果未指定身份验证方法，则使用动态的默认值。默认情况下，IPSec 策略使用 Kerberos V5 身份验证。如果该计算机具有计算机证书，则与该计算机证书链接的任意根 CA 也可用作身份验证。<br />
    <br />
    &nbsp;</li>
    <li>如果指定了 <strong>excludecaname:yes</strong>，则受信任的根 CA 的列表不作为证书申请的一部分被发送，从而杜绝了有关计算机信任关系的敏感信息泄漏的可能性。要增强连接到 Internet 的计算机的安全性，请指定该选项。<br />
    <br />
    &nbsp;</li>
    <li>不推荐使用预共享密钥身份验证方法，因为相对来说它是一种比较弱的身份验证方法。此外，预共享密钥以明文方式存储。<br />
    <br />
    &nbsp;</li>
    <li>IPSec 双方都必须有至少一个通用身份验证方法，否则通讯将失败。 <br />
    <br />
    &nbsp;</li>
    <li>修改身份认证方法将会覆盖所有以前的身份认证方法，即使以前的身份认证方法有所不同。例如，如果已指定了 <strong>kerberos=yes</strong> 和 <strong>psk=yes</strong>，而后又指定了 <strong>kerberos=no</strong>，则 <strong>psk=yes</strong> 参数也将被覆盖，而且不再使用预共享的密钥身份验证。<br />
    <br />
    &nbsp;</li>
    <li>不能将 <em>ConfAlg</em> 和 <em>AuthAlg</em> 同时设置为<strong>无</strong>。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">set filteraction</h4>
<div class="subSection">
<p>修改筛选器操作。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>set filteraction</strong><strong>name=</strong> | <strong>guid=</strong>[<strong>newname=</strong>] [<strong>description=</strong>][<strong>qmpfs=</strong>][<strong>inpass=</strong>] [<strong>soft=</strong>][<strong>action=</strong>][<strong>qmsecmethods=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>guid</strong>= <em>guid</em></strong> </dt><dd>必需。指定要修改的筛选器操作的名称或全局唯一标识符 (GUID)。</dd></dl><dl><dt><strong>[ <strong>newname=</strong><em>字符串</em>] </strong></dt><dd>指定筛选器操作的新名称。</dd></dl><dl><dt><strong>[ <strong>description=</strong><em>字符串</em>] </strong></dt><dd>提供有关筛选器操作的信息。</dd></dl><dl><dt><strong>[ <strong>qmpfs=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定是否启用会话密钥完全向前保密 (PFS)。如果指定 <strong>yes</strong>，则每当要求新的会话密钥时都需要重新协商新的主密钥材料。</dd></dl><dl><dt><strong>[ <strong>inpass=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定是否允许与配置的筛选器列表匹配的传入数据包不采取安全措施，但是要求答复时提供采取安全措施的 IPSec 通讯。</dd></dl><dl><dt><strong>[ <strong>soft=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定当其他计算机不支持 IPSec 时，或者与具有 IPSec 功能的计算机进行 IPSec 协商失败时，是否重新使用不安全的通讯。</dd></dl><dl><dt><strong>[ <strong>action=</strong>{<strong>permit</strong> | <strong>block</strong> | <strong>negotiate</strong>}] </strong></dt><dd>指定是否允许通讯而不协商 IP 安全性。如果指定 <strong>permit</strong>，则可在不协商或不应用 IP 安全的情况下，传输或接收通讯。如果指定 <strong>block</strong>，则通讯将被阻止。如果指定了 <strong>negotiate</strong>，则使用带有指定安全措施列表的 IP 安全。</dd></dl><dl><dt><strong>[ <strong>qmsecmethods=&quot;</strong><em>Neg1Neg2</em><strong>&quot;</strong>] </strong></dt><dd>指定由空格分隔并按以下格式定义的一个或多个安全措施： {<strong>ESP</strong> [<em>ConfAlg</em>,<em>AuthAlg</em>]<strong>:</strong><em>k</em>/<em>s</em> | <strong>AH</strong> [<em>HashAlg</em>]<strong>:</strong><em>k/s</em> | <strong>AH</strong> [<em>HashAlg</em>+<strong>ESP</strong><em>ConfAlg</em>,<em>AuthAlg</em>]<strong>:</strong><em>k</em>/<em>s</em>}] 其中： <dl><dt><strong><em>ConfAlg</em></strong> </dt><dd>指定加密算法。<em>ConfigAlg</em> 可以是 <strong>DES</strong>（数据加密标准）、<strong>3DES</strong> 或<strong>无</strong>。 </dd></dl><dl><dt><strong><em>AuthAlg</em></strong> </dt><dd>指定完整性算法。<em>AuthAlg</em> 可以是 <strong>MD5</strong>（消息摘要 5）、<strong>SHA1</strong>（安全哈希算法 1）或<strong>无</strong>。</dd></dl><dl><dt><strong><em>HashAlg</em></strong> </dt><dd>指定哈希函数。<em>HashAlg</em> 可以是 <strong>MD5</strong>（消息摘要 5）或 <strong>SHA1</strong>（安全哈希算法 1）。</dd></dl><dl><dt><strong><em>k</em></strong> </dt><dd>指定以千字节为单位的会话密钥生命周期。传输了指定千字节的数据后，会为快速模式 SA 生成新的会话密钥。默认值为 100000 千字节。</dd></dl><dl><dt><strong><em>s</em></strong> </dt><dd>指定以秒为单位的会话密钥生命周期。默认值是 3600 秒。</dd></dl></dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>为筛选器操作指定新名称时，不要使用名称 <strong>all</strong>。这样做会与选择所有 IPSec 筛选器操作的 <strong>netsh ipsec</strong> 选项（例如 <strong>delete filteraction all</strong>）产生冲突。<br />
    <br />
    &nbsp;</li>
    <li>如果指定了 <strong>action=permit</strong> 或 <strong>action=block</strong>，请不要设置 <strong>qmpfs=yes</strong>、<strong>inpass=yes</strong> 或 <strong>soft=yes</strong>。<br />
    <br />
    &nbsp;</li>
    <li>启动会话密钥的重新生成基于首先到达的时间间隔（秒或千字节）。如果未配置新间隔，则将使用默认间隔。<br />
    <br />
    &nbsp;</li>
    <li>如果以前没有为该筛选器操作指定 <strong>qmsecmethods=</strong>（快速模式安全方法），将使用以下默认设置： <br />
    <br />
    <ul>
        <li>ESP [3DES, SHA1]:100000s/3600k<br />
        <br />
        &nbsp;</li>
        <li>ESP [3DES, MD5]:100000s/3600k<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>在命令中指定的每个快速模式安全措施的顺序决定了该安全措施的首选顺序。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">set filterlist</h4>
<div class="subSection">
<p>修改筛选器列表。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>set filterlist</strong><strong>name=</strong> [<strong>newname=</strong>] [<strong>description=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em></strong> </dt><dd>必需。指定要修改的筛选器列表的名称。</dd></dl><dl><dt><strong>[ <strong>newname=</strong><em>字符串</em>] </strong></dt><dd>指定筛选器列表的新名称。</dd></dl><dl><dt><strong>[ <strong>description=</strong><em>字符串</em>] </strong></dt><dd>提供有关筛选器列表的信息。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>为筛选器列表指定新名称时，不要使用名称 <strong>all</strong>。这样做会与选择所有 IPSec 筛选器列表的 <strong>netsh ipsec</strong> 选项（例如 <strong>delete filterlist all</strong>）产生冲突。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">set policy</h4>
<div class="subSection">
<p>修改 IPSec 策略。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>set policy</strong><strong>name=</strong><strong>newname=</strong> [<strong>description=</strong>][<strong>mmpfs=</strong>][<strong>qmpermm=</strong>] [<strong>mmlifetime=</strong>][<strong>activatedefaultrule=</strong>][<strong>pollinginterval=</strong>][<strong>assign=</strong>][<strong>gponame=</strong>][<strong>mmsecmethods=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>guid=</strong><em>guid</em></strong> </dt><dd>必需。指定要修改的 IPSec 策略的名称或 GUID。</dd></dl><dl><dt><strong><strong>newname=</strong><em>字符串</em></strong> </dt><dd>必需。为 IPSec 策略指定新名称。</dd></dl><dl><dt><strong>[ <strong>description=</strong><em>字符串</em>] </strong></dt><dd>提供有关 IPSec 策略的信息。</dd></dl><dl><dt><strong>[ <strong>mmpfs=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定是否启用主密钥完全向前保密 (PFS)。如果指定 <strong>yes</strong>，则主模式安全 SA 将被重新验证，而且每当要求提供快速模式 SA 的会话密钥材料时都需要协商新的主密钥的密钥材料。</dd></dl><dl><dt><strong>[ <strong>qmpermm=</strong><em>Integer</em>] </strong></dt><dd>指定主密钥材料可用来派生会话密钥的次数。</dd></dl><dl><dt><strong>[ <strong>mmlifetime=</strong><em>Integer</em>] </strong></dt><dd>指定生成新主密钥所需的分钟数。</dd></dl><dl><dt><strong>[ <strong>activatedefaultrule=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定是否为该 IPSec 策略激活默认响应规则。</dd></dl><dl><dt><strong>[ <strong>pollinginterval=</strong><em>Integer</em>] </strong></dt><dd>指定为了解该策略的变化而进行轮询的频率。默认值为 180 分钟。</dd></dl><dl><dt><strong>[ <strong>assign=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定是否指派该 IPSec 策略。</dd></dl><dl><dt><strong>[ <strong>gponame=</strong><em>字符串</em>] </strong></dt><dd>指定为其指派 IPSec 策略的组策略对象的名称。只有在为作为 Active Directory 域成员的计算机配置策略时，该参数才是适用的。</dd></dl><dl><dt><strong>[ <strong>mmsecmethods=&quot;</strong><em>SecMeth1SecMeth2</em><strong>&quot;</strong>] </strong></dt><dd>指定由空格分隔并按以下格式定义的一个或多个密钥交换安全措施：<em>ConfAlg</em>-<em>HashAlg</em>-<em>GroupNumb</em>，其中： <dl><dt><strong><em>ConfAlg</em></strong> </dt><dd>指定加密算法。<em>ConfAlg</em> 可以是 <strong>DES</strong>（数据加密标准）或 <strong>3DES</strong>。 </dd></dl><dl><dt><strong><em>HashAlg</em></strong> </dt><dd>指定哈希函数。<em>HashAlg</em> 可以是 <strong>MD5</strong>（消息摘要 5）或 <strong>SHA1</strong>（安全哈希算法 1）。</dd></dl><dl><dt><strong><em>GroupNum</em></strong> </dt><dd>指定用于基本密钥材料的 Diffie-Hellman 组。<em>GroupNumb</em> 可以为：<strong>1</strong>（低，使用 768 位密钥材料保护），<strong>2</strong>（中等，使用 1024 位保护）以及 <strong>3</strong>（高，使用 2048 位保护）。 </dd></dl></dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>如果为策略指定新的名称，请不要使用名称 <strong>all</strong>。这样做会与选择所有 IPSec 策略的 <strong>netsh ipsec</strong> 选项（例如 <strong>delete policy all</strong>）产生冲突。<br />
    <br />
    &nbsp;</li>
    <li>如果指定了 <strong>set store=domain</strong>（当 IPSec 策略存储在 Active Directory 中时），<strong>assign</strong> 将无效。<br />
    <br />
    &nbsp;</li>
    <li>如果指定 <strong>mmpfs=yes</strong>（启用主密钥 PFS），则 <strong>qmperm</strong> 的默认设置为 1 且不可配置，因为每一个新会话都将使主密钥的密钥材料被重新协商。<br />
    <br />
    &nbsp;</li>
    <li>IPSec 双方都必须具有至少一个通用的密钥交换安全措施（使用相同设置的措施），否则协商将会失败。 <br />
    <br />
    &nbsp;</li>
    <li>如果设置为 <strong>set store=domain</strong>，则只能指定一个组策略对象名称。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">set rule</h4>
<div class="subSection">
<p>修改 IPSec 策略中的规则。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>set rule</strong><strong>name=</strong> | <strong>ID=policy=</strong> [<strong>newname=</strong>][<strong>description=</strong>][<strong>filterlist=</strong>] [<strong>filteraction=</strong>] [<strong>tunnel=</strong>][<strong>conntype=</strong>] [<strong>activate=</strong>][<strong>kerberos=</strong>][<strong>psk=</strong>][<strong>rootca=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>ID=</strong><em>Integer</em></strong> </dt><dd>必需。指定要修改的规则的名称或 ID（标识规则在策略规则列表中的位置的编号）。</dd></dl><dl><dt><strong><strong>policy=</strong><em>字符串</em></strong> </dt><dd>必需。指定包含该规则的 IPSec 策略的名称。</dd></dl><dl><dt><strong>[ <strong>newname=</strong><em>字符串</em>] </strong></dt><dd>指定规则的新名称。</dd></dl><dl><dt><strong>[ <strong>description=</strong><em>字符串</em>] </strong></dt><dd>提供有关该规则的信息。</dd></dl><dl><dt><strong>[ <strong>filterlist=</strong><em>字符串</em>] </strong></dt><dd>指定适用于该规则的 IP 筛选器列表的名称。</dd></dl><dl><dt><strong>[ <strong>filteraction=</strong><em>字符串</em>] </strong></dt><dd>指定适用于该规则的 IP 筛选器操作的名称。</dd></dl><dl><dt><strong>[ <strong>tunnel=</strong>{<em>IPAddress</em> | <em>DNSName</em>}] </strong></dt><dd>为隧道模式指定隧道端点的 IP 地址或 DNS 名称。</dd></dl><dl><dt><strong>[ <strong>conntype=</strong>{<strong>lan</strong> | <strong>dialup</strong> | <strong>all</strong>}] </strong></dt><dd>指定该规则是仅应用于远程访问、拨号连接或局域网 (LAN) 连接，还是应用于所有连接。</dd></dl><dl><dt><strong>[ <strong>activate=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定是否为指定的 IPSec 策略激活该规则。</dd></dl><dl><dt><strong>[ <strong>kerberos=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定是否将 Kerberos V5 协议作为身份验证方法。</dd></dl><dl><dt><strong>[ <strong>psk=</strong><em>字符串</em>] </strong></dt><dd>如果将预共享的密钥作为身份验证方法，则指定用于该预共享密钥的字符串。</dd></dl><dl><dt><strong>[ <strong>rootca=&quot;</strong><em>String</em><strong>certmap:</strong>{<strong>yes</strong>| <strong>no</strong>} <strong>excludecaname:</strong>{<strong>yes</strong>| <strong>no</strong>} <strong>&quot;</strong>] </strong></dt><dd>指定证书身份验证选项，其中： <dl><dt><strong><em>String </em></strong></dt><dd>如果将证书作为身份验证方法，则指定该证书的可分辨名称。</dd></dl><dl><dt><strong><strong>certmap:</strong>{<strong>yes</strong>|<strong>no</strong>} </strong></dt><dd>指定是否启用证书到帐户的映射。可以启用证书到帐户映射，以验证证书是否正在被受信任的计算机使用。</dd></dl><dl><dt><strong><strong>excludecaname:</strong>{<strong>yes</strong>|<strong>no</strong>} </strong></dt><dd>指定是否从证书申请中排除受信任的根 CA 名称列表（从中接受证书）。 </dd></dl></dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>对于作为 Active Directory 域成员的计算机，只能使用 Kerberos V5 身份验证或证书到帐户的映射。<br />
    <br />
    &nbsp;</li>
    <li>尽管只能使用一个预共享的密钥进行身份验证，但是如果为每个要使用的证书都指定一次 <strong>rootca</strong> 参数，则可以使用多个证书。<br />
    <br />
    &nbsp;</li>
    <li>所有的证书身份验证参数都必须包含在引号中。嵌入式引号标记必须用后面跟撇号的反斜杠替换 (\')。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
    <li>在命令中为每个身份验证方法指定的顺序决定了该方法的首选顺序。<br />
    <br />
    &nbsp;</li>
    <li>如果未指定身份验证方法，则使用动态的默认值。默认情况下，IPSec 策略使用 Kerberos V5 身份验证。如果该计算机具有计算机证书，则与该计算机证书链接的任意根 CA 也可用作身份验证。<br />
    <br />
    &nbsp;</li>
    <li>如果指定了 <strong>excludecaname:yes</strong>，则受信任的根 CA 的列表不作为证书申请的一部分被发送，从而杜绝了有关计算机信任关系的敏感信息泄漏的可能性。要增强连接到 Internet 的计算机的安全性，请指定该选项。<br />
    <br />
    &nbsp;</li>
    <li>不推荐使用预共享密钥身份验证方法，因为相对来说它是一种比较弱的身份验证方法。此外，预共享密钥以明文方式存储。<br />
    <br />
    &nbsp;</li>
    <li>IPSec 双方都必须有至少一个通用身份验证方法，否则通讯将失败。 <br />
    <br />
    &nbsp;</li>
    <li>修改身份认证方法将会覆盖所有以前的身份认证方法，即使以前的身份认证方法有所不同。例如，如果已指定了 <strong>kerberos=yes</strong> 和 <strong>psk=yes</strong>，而后又指定了 <strong>kerberos=no</strong>，则 <strong>psk=yes</strong> 参数也将被覆盖，而且不再使用预共享的密钥身份验证。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">set store</h4>
<div class="subSection">
<p>设置当前 IPSec 策略的存储位置。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>set store</strong><strong>location=</strong> [<strong>domain=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>location=</strong>{<strong>local</strong> | <strong>persistent</strong> | <strong>domain</strong>} </strong></dt><dd>必需。指定 IPSec 策略的存储位置。</dd></dl><dl><dt><strong>[ <strong>domain=</strong>] </strong></dt><dd>如果策略存储在 Active Directory 中（当指定 <strong>location=domain</strong> 时），则指定存储 IPSec 策略的域的名称。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li><strong>set store</strong> 命令仅在 netsh 上下文中有效，就是说： <br />
    <br />
    <ul>
        <li>如果从 <strong>netsh ipsec</strong> 上下文的命令提示符下运行该命令；<br />
        <br />
        &nbsp;</li>
        <li>如果通过使用 <strong>netsh.exe</strong> 命令运行批处理文件。<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>持久存储中包含 IPSec 策略，通过指派这些策略，可以保护该计算机在启动时（在应用本地策略或基于域的策略之前）的安全。一旦出现故障，持久 IPSec 策略将提供安全保护，因为无论应用的是本地策略还是基于域的策略（例如，如果 IPSec 策略被破坏，则可能不会应用该策略），持久 IPSec 策略都将保持有效。为了增强安全性，建议您创建并指派持久策略。<br />
    <br />
    &nbsp;</li>
    <li>可以指派本地存储中包含的 IPSec 策略来保护该计算机的安全。如果域策略可用，将应用域策略而不是本地策略。<br />
    <br />
    &nbsp;</li>
    <li>可以指派域存储中包含的 IPSec 策略来保护域中计算机组的安全。 <br />
    <br />
    &nbsp;</li>
    <li>建议将持久策略设置为所有策略中限制性最严格的策略。域策略和本地策略应当补充持久策略。<br />
    <br />
    &nbsp;</li>
    <li>使用 <strong>set machine</strong> 命令来配置远程计算机。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">show all</h4>
<div class="subSection">
<p>显示所有 IPSec 策略、规则、筛选器列表和筛选器操作的配置信息。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show all</strong> [<strong>format=</strong>] [<strong>wide=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong>[ <strong>format=</strong>{<strong>list</strong> | <strong>table</strong>}] </strong></dt><dd>指定以屏幕格式还是以制表符分隔的格式显示 IPSec 配置信息。默认值为 <strong>list</strong>，表示以屏幕格式显示输出。 </dd></dl><dl><dt><strong>[ <strong>wide=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定是否允许 IPSec 配置信息的显示超过 80 个字符的屏幕宽度。默认值为 <strong>no</strong>，表示配置信息的显示限制在屏幕宽度之内。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>由于 <strong>show all</strong> 命令可能会产生冗长和快速滚动的输出，所以可以考虑将输出保存在一个文本文件中，除非您仅需查看有限的部分。 <br />
    <br />
    要将 <strong>show all</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一：<br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec static show all</strong><br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>netsh ipsec static show all &gt;</strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>要停止输出 IPSec 配置信息，必须通过执行以下操作之一退出 <strong>Netsh</strong>： <br />
    <br />
    <ul>
        <li>单击 <strong>Netsh</strong> 窗口右上角的&ldquo;X&rdquo;图标关闭该窗口。<br />
        <br />
        &nbsp;</li>
        <li>使用&ldquo;任务管理器&rdquo;结束 <strong>Netsh</strong> 程序。 <br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
<h4 class="subHeading">show filteraction</h4>
<div class="subSection">
<p>显示一个或多个筛选器操作的配置信息。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show filteraction</strong><strong>name= </strong>| <strong>rule=</strong> |<strong> all</strong> [<strong>level=</strong>][<strong>format=</strong>] [<strong>wide=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>rule=</strong><em>字符串</em>| <strong>all</strong></strong> </dt><dd>必需。指定一个或多个将显示其配置信息的筛选器操作。如果指定了 <strong>name</strong>，将显示具有指定名称的筛选器操作。如果指定了 <strong>rule</strong>，将显示与指定的规则关联的所有筛选器操作。如果指定了 <strong>all</strong>，将显示所有筛选器操作。 </dd></dl><dl><dt><strong>[ <strong>level=</strong>{<strong>verbose</strong> | <strong>normal</strong>}] </strong></dt><dd>指定要显示的信息的级别。如果指定了 <strong>verbose</strong>，除了基本筛选器操作信息以外，还将显示有关安全方法、策略存储位置以及是否启用会话密钥完全向前保密 (PFS) 的信息。默认值为 <strong>normal</strong>。</dd></dl><dl><dt><strong>[ <strong>format=</strong>{<strong>list</strong> | <strong>table</strong>}] </strong></dt><dd>指定以屏幕格式还是以制表符分隔的格式显示 IPSec 配置信息。默认值为 <strong>list</strong>，表示以屏幕格式显示输出。 </dd></dl><dl><dt><strong>[ <strong>wide=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定是否允许 IPSec 配置信息的显示超过 80 个字符的屏幕宽度。默认值为 <strong>no</strong>，表示配置信息的显示限制在屏幕宽度之内。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
    <li>由于 <strong>show filteraction</strong> 命令可能会产生冗长和快速滚动的输出，所以可以考虑将输出保存在一个文本文件中，除非您仅需查看有限的部分。 <br />
    <br />
    要将 <strong>show filteraction</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一：<br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec static show filteraction</strong><em>Name</em> | <em>Rule</em> | <strong>all</strong> [<strong>level=verbose</strong> | <strong>normal</strong>]<br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>netsh ipsec static show filteraction</strong><em>Name</em> | <em>Rule</em> | <strong>all</strong> [<strong>level=verbose</strong> | <strong>normal</strong>] &gt;<em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>要停止输出 IPSec 配置信息，必须通过执行以下操作之一退出 <strong>Netsh</strong>： <br />
    <br />
    <ul>
        <li>单击 <strong>Netsh</strong> 窗口右上角的&ldquo;X&rdquo;图标关闭该窗口。<br />
        <br />
        &nbsp;</li>
        <li>使用&ldquo;任务管理器&rdquo;结束 <strong>Netsh</strong> 程序。<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
<h4 class="subHeading">show filterlist</h4>
<div class="subSection">
<p>显示一个或多个筛选器列表的配置信息。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show filterlist</strong><strong>name= </strong>| <strong>rule=</strong> |<strong> all</strong> [<strong>level=</strong>][<strong>format=</strong>][<strong>resolvedns=</strong>] [<strong>wide=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>rule=</strong><em>字符串</em>| <strong>all</strong></strong> </dt><dd>必需。指定要显示的一个或多个筛选器列表。如果指定了 <strong>name</strong>，将显示具有指定名称的筛选器列表。如果指定了 <strong>rule</strong>，将显示与指定的规则关联的所有筛选器列表。如果指定了 <strong>all</strong>，将显示所有筛选器列表。 </dd></dl><dl><dt><strong>[ <strong>level=</strong>{<strong>verbose</strong> | <strong>normal</strong>}] </strong></dt><dd>指定要显示的信息的级别。如果指定了 <strong>verbose</strong>，除了基本筛选器列表信息以外，还将显示由每个筛选器所定义的 IP 通讯的源、目标和类型。默认值为 <strong>normal</strong>。</dd></dl><dl><dt><strong>[ <strong>format=</strong>{<strong>list</strong> | <strong>table</strong>}] </strong></dt><dd>指定以屏幕格式还是以制表符分隔的格式显示 IPSec 配置信息。默认值为 <strong>list</strong>，表示以屏幕格式显示输出。 </dd></dl><dl><dt><strong>[ <strong>resolvedns=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定当显示源和目标时是否解析与 IP 地址相关的域名系统 (DNS) 或 NETBIOS 计算机名称。如果指定了 <strong>yes</strong>，则还必须将 <strong>level</strong> 设置为 <strong>verbose</strong>，否则将不显示 DNS 名称。默认值为 <strong>no</strong>。 </dd></dl><dl><dt><strong>[ <strong>wide=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定是否允许 IPSec 配置信息的显示超过 80 个字符的屏幕宽度。默认值为 <strong>no</strong>，表示配置信息的显示限制在屏幕宽度之内。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
    <li>由于 <strong>show filterlist</strong> 命令可能会产生冗长和快速滚动的输出，所以可以考虑将输出保存在一个文本文件中，除非您仅需查看有限的部分。 <br />
    <br />
    要将 <strong>show all</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一：<br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec static show filterlist</strong><em>Name</em> | <em>rule</em> | <strong>all</strong> [<strong>level=verbose</strong> | <strong>normal</strong>][<strong>resolvedns=yes</strong> | <strong>no</strong><br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>netsh ipsec static show filterlist</strong><em>Name</em> | <em>rule</em> | <strong>all</strong> [<strong>level=verbose</strong> | <strong>normal</strong>][<strong>resolvedns=yes</strong> | <strong>no</strong> &gt;<em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>要停止输出 IPSec 配置信息，必须通过执行以下操作之一退出 <strong>Netsh</strong>： <br />
    <br />
    <ul>
        <li>单击 <strong>Netsh</strong> 窗口右上角的&ldquo;X&rdquo;图标关闭该窗口。<br />
        <br />
        &nbsp;</li>
        <li>使用&ldquo;任务管理器&rdquo;结束 <strong>Netsh</strong> 程序。 <br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
<h4 class="subHeading">show gpoassignedpolicy</h4>
<div class="subSection">
<p>显示指派给特定组策略对象的活动 IPSec 策略的配置信息。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show gpoassignedpolicy</strong> [<strong>name= </strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong>[ <strong>name=</strong><em>字符串</em>] </strong></dt><dd>指定为其指派活动 IPSec 策略的组策略对象的名称。如果没有指定名称，将显示本地 IPSec 策略。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>如果设置为 <strong>set store=domain</strong>，则只能指定一个组策略对象名称。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。 <br />
    <br />
    要将 <strong>show gpossignedpolicy</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一：<br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec static show gpoassignedpolicy</strong> [<em>Name</em>]<br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>netsh ipsec static show gpoassignedpolicy</strong> [<em>Name</em>] &gt;<em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
<h4 class="subHeading">show policy</h4>
<div class="subSection">
<p>显示指定 IPSec 策略或所有 IPSec 策略的配置信息。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show policy</strong><strong>name=</strong> | <strong>all</strong> [<strong>level=</strong>] [<strong>format=</strong>] [<strong>wide=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>all</strong></strong> </dt><dd>必需。指定要显示的 IPSec 策略的名称，或者如果指定了 <strong>all</strong>，则显示所有 IPSec 策略。 </dd></dl><dl><dt><strong>[ <strong>level=</strong>{<strong>verbose</strong> | <strong>normal</strong>}] </strong></dt><dd>指定要显示的信息的级别。如果指定了 <strong>verbose</strong>，除了有关筛选器操作和规则的信息以外，还将显示安全方法和身份验证方法。默认值为 <strong>normal</strong>。</dd></dl><dl><dt><strong>[ <strong>format=</strong>{<strong>list</strong> | <strong>table</strong>}] </strong></dt><dd>指定以屏幕格式还是以制表符分隔的格式显示 IPSec 配置信息。默认值为 <strong>list</strong>，表示以屏幕格式显示输出。 </dd></dl><dl><dt><strong>[ <strong>wide=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定是否允许 IPSec 配置信息的显示超过 80 个字符的屏幕宽度。默认值为 <strong>no</strong>，表示配置信息的显示限制在屏幕宽度之内。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
    <li>由于 <strong>show policy</strong> 命令可能会产生冗长和快速滚动的输出，所以可以考虑将输出保存在一个文本文件中，除非您仅需查看有限的部分。 <br />
    <br />
    要将 <strong>show policy</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一：<br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec static show policy</strong><em>Name</em> | <strong>all</strong> &gt;<em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>netsh ipsec static show policy</strong><em>Name</em> | <strong>all</strong> &gt;<em>FileName</em><strong>.txt</strong><br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>要停止输出 IPSec 配置信息，必须通过执行以下操作之一退出 <strong>Netsh</strong>： <br />
    <br />
    <ul>
        <li>单击 <strong>Netsh</strong> 窗口右上角的&ldquo;X&rdquo;图标关闭该窗口。<br />
        <br />
        &nbsp;</li>
        <li>使用&ldquo;任务管理器&rdquo;结束 <strong>Netsh</strong> 程序。 <br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
<h4 class="subHeading">show rule</h4>
<div class="subSection">
<p>显示指定策略的某个规则的配置信息，或指定策略的所有规则的配置信息。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show rule</strong><strong>name= </strong>| <strong>ID=</strong> | <strong>all</strong> | <strong>defaultpolicy=</strong> [<strong>type=</strong>][<strong>level=</strong>][<strong>format=</strong>] [<strong>wide=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong>{<em>字符串</em> | <strong>ID=</strong><em>Integer</em> | <strong>all</strong> | <strong>default</strong>} </strong></dt><dd>必需。指定要显示的一个或多个规则。如果指定了规则名称或规则 ID（用来标识规则在策略规则列表中的位置的编号），将显示相应的规则。如果指定了 <strong>all</strong>，将显示指定策略的所有规则。如果指定了 <strong>default</strong>，将显示默认响应规则。</dd></dl><dl><dt><strong><strong>policy=</strong><em>字符串</em></strong> </dt><dd>必需。指定要显示其指定规则或所有规则的策略的名称。</dd></dl><dl><dt><strong>[ <strong>type=</strong>{<strong>transport</strong> | <strong>tunnel</strong>}] </strong></dt><dd>指定是否显示所有传输规则或所有隧道规则。默认值是显示所有规则。</dd></dl><dl><dt><strong>[ <strong>level=</strong>{<strong>verbose</strong> | <strong>normal</strong>}] </strong></dt><dd>指定要显示的信息的级别。如果指定了 <strong>verbose</strong>，除了显示与规则有关的基本信息以外，还将显示与关联的筛选器操作有关的信息。默认值为 <strong>normal</strong>。</dd></dl><dl><dt><strong>[ <strong>format=</strong>{<strong>list</strong> | <strong>table</strong>}] </strong></dt><dd>指定以屏幕格式还是以制表符分隔的格式显示 IPSec 配置信息。默认值为 <strong>list</strong>，表示以屏幕格式显示输出。 </dd></dl><dl><dt><strong>[ <strong>wide=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定是否允许 IPSec 配置信息的显示超过 80 个字符的屏幕宽度。默认值为 <strong>no</strong>，表示配置信息的显示限制在屏幕宽度之内。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>如果使用 <strong>type</strong> 参数，还必须使用 <strong>all</strong> 参数（必须指定 <strong>show rule all</strong>）。 <br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
    <li>由于 <strong>show rule</strong> 命令可能会产生冗长和快速滚动的输出，所以可以考虑将输出保存在一个文本文件中，除非您仅需查看有限的部分。 <br />
    <br />
    要将 <strong>show rule</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一：<br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec static show rule</strong><em>Name</em> | <em>ID</em> | <strong>all</strong> | <strong>default</strong><em>Policy</em> [<strong>level=verbose</strong> | <strong>normal</strong>]<br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>netsh ipsec static show rule</strong><em>Name</em> | <em>ID</em> | <strong>all</strong> | <strong>default</strong><em>Policy</em> [<strong>level=verbose</strong> | <strong>normal</strong>] &gt;<em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>要停止输出 IPSec 配置信息，必须通过执行以下操作之一退出 <strong>Netsh</strong>： <br />
    <br />
    <ul>
        <li>单击 <strong>Netsh</strong> 窗口右上角的&ldquo;X&rdquo;图标关闭该窗口。<br />
        <br />
        &nbsp;</li>
        <li>使用&ldquo;任务管理器&rdquo;结束 <strong>Netsh</strong> 程序。 <br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
</div>
</div>
<h2 class="heading">Netsh ipsec dynamic</h2>
<div id="sectionSection5" class="section">
<p>下列命令可在 <strong>ipsec dynamic </strong>&gt; 提示符下使用，该提示符在 netsh 上下文中为根级提示符。</p>
<p>若要查看该命令语法，请单击以下命令：</p>
<ul>
    <li><font color="#0033cc">add mmpolicy</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">add qmpolicy</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">add rule</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">delete all</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">delete mmpolicy</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">delete qmpolicy</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">delete rule</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">set config</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">set mmpolicy</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">set qmpolicy</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">set rule</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show all</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show config</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show mmfilter</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show mmpolicy</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show mmsas</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show qmfilter</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show qmpolicy</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show qmsas</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show rule</font><br />
    <br />
    &nbsp;</li>
    <li><font color="#0033cc">show stats</font><br />
    <br />
    &nbsp;</li>
</ul>
<div class="subSection">
<h4 class="subHeading">add mmpolicy</h4>
<div class="subSection">
<p>创建具有指定名称的 IPSec 主模式策略，并将它添加到安全策略数据库 (SPD) 中。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>add mmpolicy</strong><strong>name=</strong> [<strong>qmpermm=</strong>] [<strong>mmlifetime=</strong>][<strong>softsaexpirationtime=</strong>][<strong>mmsecmethods=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em></strong> </dt><dd>必需。指定要创建的 IPSec 策略的名称。</dd></dl><dl><dt><strong>[ <strong>qmpermm=</strong><em>Integer</em>] </strong></dt><dd>指定主密钥材料可用来派生会话密钥的次数。默认值为 0，这意味着可以从主模式 SA 派生出无限多个快速模式 SA。</dd></dl><dl><dt><strong>[ <strong>mmlifetime=</strong><em>Integer</em>] </strong></dt><dd>指定生成新主密钥所需的分钟数。默认值为 480 分钟。</dd></dl><dl><dt><strong>[ <strong>softsaexpirationtime=</strong><em>Integer</em>] </strong></dt><dd>指定未受保护的安全关联存活的分钟数。默认值为 480 分钟。</dd></dl><dl><dt><strong>[ <strong>mmsecmethods=&quot;</strong><em>SecMeth1SecMeth2</em><strong>&quot;</strong>] </strong></dt><dd>指定由空格分隔并按以下格式定义的一个或多个密钥交换安全措施：<em>ConfAlg</em>-<em>HashAlg</em>-<em>GroupNumb</em>，其中： <dl><dt><strong><em>ConfAlg</em></strong> </dt><dd>指定加密算法。<em>ConfAlg</em> 可以是 <strong>DES </strong>或 <strong>3DES</strong>。 </dd></dl><dl><dt><strong><em>HashAlg</em></strong> </dt><dd>指定哈希函数。<em>HashAlg</em> 可以是 <strong>MD5</strong> 或 <strong>SHA1</strong>。</dd></dl><dl><dt><strong><em>GroupNum</em></strong> </dt><dd>指定用于基本密钥材料的 Diffie-Hellman 组。<em>GroupNumb</em> 可以为：<strong>1</strong>（低，使用 768 位密钥材料保护），<strong>2</strong>（中等，使用 1024 位保护）以及 <strong>3</strong>（高，使用 2048 位保护）。 </dd></dl></dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>不要创建名称为 <strong>all</strong> 的主模式策略。这样做会与选择所有主模式 IPSec 策略的 <strong>netsh ipsec</strong> 选项（例如 <strong>delete mmpolicy all</strong>）产生冲突。<br />
    <br />
    &nbsp;</li>
    <li>在主模式生命周期内，如果快速模式协商数超过按照主模式协商为快速模式协商数设置的值，将发生新的主模式协商。<br />
    <br />
    &nbsp;</li>
    <li>如果未指定 <strong>mmsecmethods=</strong>（密钥交换安全措施），则使用如下默认值： <br />
    <br />
    <ul>
        <li>3DES-SHA1-2<br />
        <br />
        &nbsp;</li>
        <li>3DES-MD5-2<br />
        <br />
        &nbsp;</li>
        <li>3DES-SHA1-3<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>IPSec 双方都必须具有至少一个通用的密钥交换安全措施（使用相同设置的措施），否则协商将会失败。 <br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">add qmpolicy</h4>
<div class="subSection">
<p>创建具有指定名称的 IPSec 快速模式策略，并将它添加到 SPD 中。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>add qmpolicy</strong><strong>name=</strong> [<strong>soft=</strong>][<strong>pfsgroup=</strong>][<strong>qmsecmethods=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em></strong> </dt><dd>必需。指定要创建的 IPSec 快速模式策略的名称。</dd></dl><dl><dt><strong>[ <strong>soft=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定当其他计算机不支持 IPSec 时，或者与具有 IPSec 功能的计算机进行 IPSec 协商失败时，是否重新使用不安全的通讯。默认值为 <strong>no</strong>。</dd></dl><dl><dt><strong>[ <strong>pfsgroup=</strong>{<strong>grp1</strong> | <strong>grp2</strong> | <strong>grp3</strong> |<strong> grpmm</strong> | <strong>nopfs</strong>}] </strong></dt><dd>指定用于会话密钥 PFS 的 Diffie-Hellman 组。如果指定 <strong>grp1</strong>，则使用&ldquo;组 1&rdquo;（低）。如果指定 <strong>grp2</strong>，则使用&ldquo;组 2&rdquo;（中）。如果指定 <strong>grp3</strong>，则使用&ldquo;组 2048&rdquo;（高）。如果指定 <strong>grpmm</strong>，则从当前主模式设置中提取组值。默认值为 <strong>nopfs</strong>，表示会话密钥 PFS 已被禁用。</dd></dl><dl><dt><strong>[ <strong>qmsecmethods=&quot;</strong><em>Neg1Neg2</em><strong>&quot;</strong>] </strong></dt><dd>指定由空格分隔并按以下格式定义的一个或多个安全措施： {<strong>ESP</strong> [<em>ConfAlg</em>,<em>AuthAlg</em>]<strong>:</strong><em>k</em>/<em>s</em> | <strong>AH</strong> [<em>HashAlg</em>]<strong>:</strong><em>k/s</em> | <strong>AH</strong> [<em>HashAlg</em>+<strong>ESP</strong><em>ConfAlg</em>,<em>AuthAlg</em>]<strong>:</strong><em>k</em>/<em>s</em>}] 其中： <dl><dt><strong><em>ConfAlg</em></strong> </dt><dd>指定加密算法。<em>ConfigAlg</em> 可以是 <strong>DES</strong>（数据加密标准）、<strong>3DES</strong> 或<strong>无</strong>。 </dd></dl><dl><dt><strong><em>AuthAlg</em></strong> </dt><dd>指定完整性算法。<em>AuthAlg</em> 可以是 <strong>MD5</strong>（消息摘要 5）、<strong>SHA1</strong>（安全哈希算法 1）或<strong>无</strong>。</dd></dl><dl><dt><strong><em>HashAlg</em></strong> </dt><dd>指定哈希函数。<em>HashAlg</em> 可以是 <strong>MD5</strong>（消息摘要 5）或 <strong>SHA1</strong>（安全哈希算法 1）。</dd></dl><dl><dt><strong><em>k</em></strong> </dt><dd>指定以千字节为单位的会话密钥生命周期。传输了指定千字节的数据后，会为快速模式 SA 生成新的会话密钥。默认值为 100000 千字节。</dd></dl><dl><dt><strong><em>s</em></strong> </dt><dd>指定以秒为单位的会话密钥生命周期。默认值是 3600 秒。</dd></dl></dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>不要创建名称为 <strong>all</strong> 的快速模式策略。这样做会与选择所有 IPSec 快速模式策略的 <strong>netsh ipsec</strong> 选项（例如 <strong>delete qmpolicy all</strong>）产生冲突。<br />
    <br />
    &nbsp;</li>
    <li>如果未指定 <strong>qmsecmethods=</strong>（快速模式安全措施），则将使用以下默认值： <br />
    <br />
    <ul>
        <li>ESP [3DES, SHA1]100000k/3600s<br />
        <br />
        &nbsp;</li>
        <li>ESP [3DES, MD5]100000k/3600s<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>不能将 <em>ConfAlg</em> 和 <em>AuthAlg</em> 同时设置为<strong>无</strong>。<br />
    <br />
    &nbsp;</li>
    <li>IPSec 双方必须启用相同的 <strong>pfsgroup</strong>（就是说，通讯双方都必须将相同的 Diffie-Hellman 组用于会话密钥 PFS），否则通讯将失败。 <br />
    <br />
    &nbsp;</li>
    <li>为了获得增强的安全性，请不要使用 Diffie-Hellman&ldquo;组 1&rdquo;。为获得最佳安全性，请尽可能使用&ldquo;组 2048&rdquo;。当需要保证与 Windows&nbsp;2000 和 Windows&nbsp;XP 的互操作性时，请使用组 2。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">add rule</h4>
<div class="subSection">
<p>创建具有指定主模式策略和快速模式策略的 IPSec 规则，并将它添加到 SPD 中。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>add rule</strong><strong>srcaddr=</strong><strong>dstaddr=</strong><strong>mmpolicy=</strong>[<strong>qmpolicy=</strong>][<strong>protocol=</strong>][<strong>srcport=</strong>][<strong>dstport=</strong>][<strong>mirrored=</strong>][<strong>conntype=</strong>][<strong>actioninbound=</strong>][<strong>actionoutbound=</strong>][<strong>srcmask=</strong>][<strong>dstmask=</strong>][<strong>tunneldstaddress=</strong>][<strong>kerberos=</strong>][<strong>psk=</strong>][<strong>rootca=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>srcaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> | <em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>} </strong></dt><dd>必需。指定 IP 通讯的源 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong><strong>dstaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> |<em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>} </strong></dt><dd>必需。指定 IP 通讯的目标 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong><strong>mmpolicy=</strong><em>字符串</em></strong> </dt><dd>必需。指定主模式策略的名称。</dd></dl><dl><dt><strong>[ <strong>qmpolicy=</strong>]<em>字符串</em></strong> </dt><dd>指定快速模式策略的名称。如果指定了 <strong>actioninbound=negotiate</strong> 或 <strong>actionoutbound=negotiate</strong>，则是必需的。</dd></dl><dl><dt><strong>[ <strong>protocol=</strong>{<strong>ANY</strong> | <strong>ICMP</strong> |<strong>TCP</strong>| <strong>UDP</strong> | <strong>RAW</strong> | <em>Integer </em>}] </strong></dt><dd>指定 IP 协议（如果除了地址信息还想筛选特定的 IP 协议）。默认值为 <strong>ANY</strong>，表示该筛选器可以使用所有协议。</dd></dl><dl><dt><strong>[ <strong>srcport=</strong><em>Port</em>] </strong></dt><dd>指定将被筛选的数据包的源端口号。该选项仅适用于筛选 TCP 或 UDP 数据包。如果指定为 0，则来自任何端口的数据包都将被筛选。默认设置为任意值。</dd></dl><dl><dt><strong>[ <strong>dstport=</strong><em>Port</em>] </strong></dt><dd>指定将被筛选的数据包的目标端口号。该选项仅适用于筛选 TCP 或 UDP 数据包。如果指定为 0，则发送到任何端口的数据包都将被筛选。默认设置为任意值。</dd></dl><dl><dt><strong>[ <strong>mirrored=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定是否创建镜像筛选器。使用 <strong>yes</strong> 可以基于筛选器设置创建两个筛选器，一个用于到目标的通讯，一个用于来自目标的通讯默认设置为 <strong>yes</strong>。</dd></dl><dl><dt><strong>[ <strong>conntype=</strong>{<strong>lan</strong> | <strong>dialup</strong> | <strong>all</strong>}] </strong></dt><dd>指定该规则是仅应用于远程访问、拨号连接或局域网 (LAN) 连接，还是应用于所有连接。默认值为 <strong>all</strong>。</dd></dl><dl><dt><strong>[ <strong>actioninbound=</strong>{<strong>permit</strong> | <strong>block</strong> | <strong>negotiate</strong>}] </strong></dt><dd>指定 IPSec 要为入站通讯执行的操作。如果指定 <strong>permit</strong>，则可在不协商或不应用 IP 安全的情况下，接收通讯。如果指定 <strong>block</strong>，则通讯将被阻止。如果指定 <strong>negotiate</strong>，将使用 IP 安全，并使用在主模式和快速模式策略中指定的安全方法列表。默认值为 <strong>negotiate</strong>。</dd></dl><dl><dt><strong>[ <strong>actionoutbound=</strong>{<strong>permit</strong> | <strong>block</strong> | <strong>negotiate</strong>}] </strong></dt><dd>指定 IPSec 要为出站通讯执行的操作。如果指定 <strong>permit</strong>，则可在不协商或不应用 IP 安全的情况下，发送通讯。如果指定 <strong>block</strong>，则通讯将被阻止。如果指定 <strong>negotiate</strong>，将使用 IP 安全，并使用在主模式和快速模式策略中指定的安全方法列表。默认值为 <strong>negotiate</strong>。</dd></dl><dl><dt><strong>[ <strong>srcmask=</strong>{<em>Mask</em> | <em>Prefix</em>}] </strong></dt><dd>指定将被筛选的数据包源地址子网掩码或前缀。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>dstmask=</strong>{<em>Mask</em> | <em>Prefix</em>}] </strong></dt><dd>指定将被筛选的数据包目标地址子网掩码或前缀值。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>tunneldstaddress=</strong>{<em>IPAddress</em> | <em>DNSName</em>}] </strong></dt><dd>指定是否使用隧道技术进行通讯，如果允许，则指定隧道目标（隧道另一端的计算机或网关）的 IP 地址或 DNS 名称。</dd></dl><dl><dt><strong>[ <strong>kerberos=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定是否将 Kerberos V5 协议作为身份验证方法。</dd></dl><dl><dt><strong>[ <strong>psk=</strong><em>字符串</em>] </strong></dt><dd>如果将预共享的密钥作为身份验证方法，则指定用于该预共享密钥的字符串。</dd></dl><dl><dt><strong>[ <strong>rootca=&quot;</strong><em>String</em><strong>certmap:</strong>{<strong>yes</strong>| <strong>no</strong>} <strong>excludecaname:</strong>{<strong>yes</strong>| <strong>no</strong>} <strong>&quot;</strong>] </strong></dt><dd>指定证书身份验证选项，其中： <dl><dt><strong><em>String </em></strong></dt><dd>如果将证书作为身份验证方法，则指定该证书的可分辨名称。 </dd></dl><dl><dt><strong><strong>certmap:</strong>{<strong>yes</strong>|<strong>no</strong>} </strong></dt><dd>指定是否启用证书到帐户的映射。可以启用证书到帐户映射，以验证证书是否正在被受信任的计算机使用。</dd></dl><dl><dt><strong><strong>excludecaname:</strong>{<strong>yes</strong>|<strong>no</strong>} </strong></dt><dd>指定是否从证书申请中排除受信任的根 CA 名称列表（从中接受证书）。 </dd></dl></dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>不要创建名为 <strong>all</strong> 的规则。这样做会与选择所有 IPSec 规则的 <strong>netsh ipsec</strong> 选项（例如 <strong>delete rule all</strong>）产生冲突。<br />
    <br />
    &nbsp;</li>
    <li>如果入站和出站通讯的筛选器操作（<strong>actioninbound</strong> 和 <strong>actionoutbound</strong>）设置为 <strong>Permit</strong> 或 <strong>Block</strong>，则不要求快速模式筛选器。<br />
    <br />
    &nbsp;</li>
    <li>如果指定了隧道规则，则应当将 <strong>mirror</strong> 设置为 <strong>no</strong>（<strong>mirror</strong> 的默认设置为 <strong>yes</strong>）。对于 IPSec 隧道，必须创建两个规则：一个规则描述将通过隧道发送的通讯（出站通讯），另一个则描述将通过隧道接收的通讯（入站）。然后创建两个规则，这些规则使用策略中的入站与出站筛选器列表。<br />
    <br />
    &nbsp;</li>
    <li>要筛选进出特定计算机的任何数据包，可以使用 <strong>srcaddr=Me</strong> 或 <strong>dstaddr=Me</strong>。<br />
    <br />
    &nbsp;</li>
    <li>要筛选进出任何计算机的数据包，可以使用 <strong>srcaddr=Any</strong> 或 <strong>dstaddr=Any</strong>。<br />
    <br />
    &nbsp;</li>
    <li>对于作为 Active Directory 域成员的计算机，只能使用 Kerberos V5 身份验证或证书到帐户的映射。<br />
    <br />
    &nbsp;</li>
    <li>尽管只能使用一个预共享的密钥进行身份验证，但是如果为每个要使用的证书都指定一次 <strong>rootca</strong> 参数，则可以使用多个证书。<br />
    <br />
    &nbsp;</li>
    <li>所有的证书身份验证参数都必须包含在引号中。嵌入式引号标记必须用后面跟撇号的反斜杠替换 (\')。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
    <li>在命令中为每个身份验证方法指定的顺序决定了该方法的首选顺序。<br />
    <br />
    &nbsp;</li>
    <li>如果未指定身份验证方法，则使用动态的默认值。默认情况下，IPSec 策略使用 Kerberos V5 身份验证。如果该计算机具有计算机证书，则与该计算机证书链接的任意根 CA 也可用作身份验证。<br />
    <br />
    &nbsp;</li>
    <li>如果指定了 <strong>excludecaname:yes</strong>，则受信任的根 CA 的列表不作为证书申请的一部分被发送，从而杜绝了有关计算机信任关系的敏感信息泄漏的可能性。要增强连接到 Internet 的计算机的安全性，请指定该选项。<br />
    <br />
    &nbsp;</li>
    <li>不推荐使用预共享密钥身份验证方法，因为相对来说它是一种比较弱的身份验证方法。此外，预共享密钥以明文方式存储。<br />
    <br />
    &nbsp;</li>
    <li>IPSec 双方都必须有至少一个通用身份验证方法，否则通讯将失败。 <br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">delete all</h4>
<div class="subSection">
<p>如果可能，从 SPD 中删除所有 IPSec 策略、筛选器和身份验证方法。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>delete all</strong></p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection">
<p>无。</p>
</div>
</div>
<h4 class="subHeading">delete mmpolicy</h4>
<div class="subSection">
<p>从 SPD 中删除指定的 IPSec 主模式策略，或所有 IPSec 主模式策略。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>delete mmpolicy</strong><strong>name=</strong> | <strong>all</strong></p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>all</strong></strong> </dt><dd>必需。指定要删除的 IPSec 主模式策略的名称。或者，如果指定了 <strong>all</strong>，则删除所有 IPSec 主模式策略。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>如果有规则与主模式策略关联，必须先删除规则然后才能删除策略。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">delete qmpolicy</h4>
<div class="subSection">
<p>从 SPD 中删除指定的 IPSec 快速模式策略，或所有 IPSec 快速模式策略。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>delete qmpolicy</strong> [<strong>name=</strong>] | [<strong>all</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>all</strong></strong> </dt><dd>必需。指定要删除的 IPSec 快速模式策略的名称。或者，如果指定了 <strong>all</strong>，则删除所有 IPSec 快速模式策略。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>如果有规则与快速模式策略关联，则必须先删除规则然后才能删除策略。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">delete rule</h4>
<div class="subSection">
<p>从 SPD 中删除 IPSec 规则。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>delete rule</strong><strong>srcaddr=</strong><strong>dstaddr=</strong><strong>protocol=</strong><strong>srcport=</strong><strong>dstport=</strong><strong>mirrored=</strong><strong>conntype=</strong>[<strong>srcmask=</strong>][<strong>dstmask=</strong>][<strong>tunneldstaddress=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>srcaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> | <em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>} </strong></dt><dd>必需。指定 IP 通讯的源 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong><strong>dstaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> |<em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>} </strong></dt><dd>必需。指定 IP 通讯的目标 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong><strong>protocol=</strong>{<strong>ANY</strong> | <strong>ICMP</strong> |<strong>TCP</strong>| <strong>UDP</strong> | <strong>RAW</strong> | <em>Integer </em>} </strong></dt><dd>必需。指定用于筛选器的 IP 协议。</dd></dl><dl><dt><strong><strong>srcport=</strong><em>Port</em></strong> </dt><dd>必需。指定当前被筛选数据包的源端口号。该选项仅适用于筛选 TCP 或 UDP 数据包。值 <strong>0</strong> 表示与源端口设置为 <strong>0</strong> 或 <strong>any</strong> 的筛选器匹配。</dd></dl><dl><dt><strong><strong>dstport=</strong><em>Port</em></strong> </dt><dd>必需。指定当前被筛选数据包的目标端口号。该选项仅适用于筛选 TCP 或 UDP 数据包。值 <strong>0 </strong>表示与目标端口设置为 <strong>0</strong> 或 <strong>any</strong> 的筛选器匹配。</dd></dl><dl><dt><strong><strong>mirrored=</strong>{<strong>yes</strong> | <strong>no</strong>} </strong></dt><dd>必需。指定是否使用镜像的筛选器创建了规则。</dd></dl><dl><dt><strong><strong>conntype=</strong>{<strong>lan</strong> | <strong>dialup</strong> | <strong>all</strong>} </strong></dt><dd>必需。指定将要删除的规则是仅应用于远程访问、拨号连接或局域网 (LAN) 连接，还是应用于所有连接。</dd></dl><dl><dt><strong>[ <strong>srcmask=</strong>{<em>Mask</em> | <em>Prefix</em>}] </strong></dt><dd>指定当前被筛选数据包的源地址子网掩码或前缀。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>dstmask=</strong>{<em>Mask</em> | <em>Prefix</em>}] </strong></dt><dd>指定当前被筛选数据包的目标地址子网掩码或前缀值。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>tunneldstaddress=</strong>{<em>IPAddress</em> | <em>DNSName</em>}] </strong></dt><dd>指定是否使用隧道技术进行通讯，如果允许，则指定隧道目标（隧道另一端的计算机或网关）的 IP 地址或 DNS 名称。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>要筛选进出特定计算机的任何数据包，可以使用 <strong>srcaddr=Me</strong> 或 <strong>dstaddr=Me</strong>。<br />
    <br />
    &nbsp;</li>
    <li>要筛选进出任何计算机的数据包，可以使用 <strong>srcaddr=Any</strong> 或 <strong>dstaddr=Any</strong>。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">set config</h4>
<div class="subSection">
<p>创建或修改下列 IPSec 设置：IPSec 诊断、默认的通讯免除、证书吊销列表 (CRL) 强制检测、IKE (Oakley) 日志记录、日志记录间隔、计算机启动安全以及计算机启动通讯免除。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>set config</strong> [<strong>property=</strong>] [<strong>value=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong>[ <strong>property=</strong>]{<strong>ipsecdiagnostics value=</strong> | <strong>ipsecexempt value=</strong> | <strong>ipsecloginterval value=</strong> | <strong>ikelogging value=</strong> | <strong>strongcrlcheck value=</strong> | <strong>bootmode value=</strong> | <strong>bootexemptions value=</strong>} </strong></dt><dd>必需。指定要创建或修改的 IPSec 设置的名称，以及该设置的值， 其中： <dl><dt><strong><strong>ipsecdiagnostics value=</strong>{<strong>0</strong> |<strong> 1</strong> | <strong>2</strong> |<strong> 3</strong> | <strong>4</strong> | <strong>5</strong> | <strong>6</strong> | <strong>7</strong>} </strong></dt><dd>指定是否启用 IPSec 诊断日志记录，如果启用，则提供哪个级别的日志记录。默认值是 <strong>0</strong>，表示禁用日志记录。如果更改该设置的值，必须重新启动计算机才能使新的值生效。 可以指定下列其他值，以启用其他级别的日志记录：
<ul>
    <li>如果指定 <strong>1</strong>，将在系统日志中记录损坏的 SPI 数据包（&ldquo;安全参数索引 (SPI)&rdquo;不正确的数据包的总数）、IKE 协商失败、IPSec 处理失败、接收到的其数据包语法无效的数据包，以及其他错误。未进行身份验证的哈希（&ldquo;Clear text received when should have been secured&rdquo;事件除外）也将记录在日志中。 <br />
    <br />
    &nbsp;</li>
    <li>如果指定 <strong>2</strong>，系统日志中将记录入站每数据包丢弃事件。 <br />
    <br />
    &nbsp;</li>
    <li>如果指定 <strong>3</strong>，则执行级别 1 和级别 2 日志。此外，还会记录意外的明文事件（以明文形式发送或接收的数据包）。 <br />
    <br />
    &nbsp;</li>
    <li>如果指定 <strong>4</strong>，系统日志中将记录出站每数据包丢弃事件。 <br />
    <br />
    &nbsp;</li>
    <li>如果指定 <strong>5</strong>，则执行级别 1 和级别 4 日志。<br />
    <br />
    &nbsp;</li>
    <li>如果指定 <strong>6</strong>，则执行级别 2 和级别 4 日志。<br />
    <br />
    &nbsp;</li>
    <li>如果指定 <strong>7</strong>，则执行所有级别的记录。<br />
    <br />
    &nbsp;</li>
</ul>
</dd></dl><dl><dt><strong><strong>ipsecexempt value=</strong>{ <strong>0</strong> | <strong>1</strong> |<strong> 2</strong> | <strong>3</strong>} </strong></dt><dd>指定是否修改默认 IPSec 通讯免除（不能通过 IPSec 筛选器但仍然允许的通讯）。默认值是 <strong>3</strong>，表示只从 IPSec 筛选中免除 IKE 通讯。如果更改该设置的值，必须重新启动计算机才能使新的值生效。 可以指定下列其他值：
<ul>
    <li>如果指定 <strong>0</strong>，将从 IPSec 筛选中免除多播、广播、RSVP、Kerberos 和 IKE 通讯。 <br />
    <br />
    &nbsp;</li>
    <li>如果指定 <strong>1</strong>，则不从 IPSec 筛选中免除 Kerberos 和 RSVP 通讯（免除多播、广播和 IKE 通讯）。<br />
    <br />
    &nbsp;</li>
    <li>如果指定 <strong>2</strong>，则不从 IPSec 筛选中免除多播和广播通讯（但免除 RSVP、Kerberos 和 IKE 通讯）。<br />
    <br />
    &nbsp;</li>
</ul>
</dd></dl><dl><dt><strong><strong>ipsecloginterval value=</strong>{<em>Integer</em>} </strong></dt><dd>指定间隔多少秒之后将 IPSec 事件日志发送到系统日志。对于 <em>Integer</em>，有效值的范围是从 <strong>60</strong> 到 <strong>86400</strong>。默认值为 <strong>3600</strong>。如果更改该设置的值，必须重新启动计算机才能使新的值生效。</dd></dl><dl><dt><strong><strong>ikelogging value=</strong>{<strong>0</strong> | <strong>1</strong>} </strong></dt><dd>指定是否启用 IKE (Oakley) 日志记录，以生成有关 SA 建立过程的详细信息。默认值是 <strong>0</strong>，表示禁用 IKE 日志记录。</dd></dl><dl><dt><strong><strong>strongcrlcheck value=</strong>{ <strong>0</strong> | <strong>1</strong> | <strong>2</strong>} </strong></dt><dd>指定要使用的 CRL 检查的级别。如果指定 <strong>0</strong>，则禁用 CRL 检查。如果指定 <strong>1</strong>，则使用标准的 CRL 检查，并且只有当确实要吊销证书时，证书验证才会失败。如果指定 <strong>2</strong>，则使用强 CRL 检查，并且如果发生任何 CRL 检查错误，证书验证都会失败。默认值为 <strong>1</strong>。</dd></dl><dl><dt><strong><strong>bootmode value=</strong>{<strong>stateful</strong> | <strong>block</strong> | <strong>permit</strong>} </strong></dt><dd>指定当计算机启动时需要 IPSec 才能执行的操作。如果指定 <strong>stateful</strong>，则在计算机启动过程中只允许下列通讯：启动过程中由计算机在启动的出站通讯、为了响应出站通讯而发送的入站通讯和 DHCP 通讯。如果指定 <strong>block</strong>，则会阻塞所有入站和出站通讯，直到应用了本地 IPSec 策略或基于域的 IPSec 策略为止。如果指定了 <strong>permit</strong>，将传输和接收所有通讯。默认值为 <strong>stateful</strong>。如果使用状态筛选，或者指定在计算机启动期间阻塞通讯，还可以使用 <strong>bootexemptions</strong> 参数来指定在计算机启动期间要从 IPSec 筛选中免除的通讯类型。 如果更改该设置的值，必须重新启动计算机才能使新的值生效。</dd></dl><dl><dt><strong><strong>bootexemptions value=</strong><em>Exemption1</em><em>Exemption2</em></strong> </dt><dd>指定从启动安全免除的一个或多个 IPSec 通讯，它们以空格分隔并按下列 TCP 和 UDP 通讯格式定义：<em>protocol</em>:<em>srcport</em>:<em>dstport</em>:<em>direction</em> 和下列非 TCP/UDP 通讯格式：<em>protocol:direction</em>，其中： <dl><dt><strong><em>protocol</em><strong>=</strong>{ <strong>ICMP</strong>| <strong>TCP</strong>| <strong>UDP</strong>| <strong>RAW</strong>| <em>Integer </em>} </strong></dt><dd>指定在计算机启动期间从 IPSec 筛选中免除的 IP 协议类型。 </dd></dl><dl><dt><strong><em>srcport</em><strong>=</strong><em>Port</em></strong> </dt><dd>指定要在计算机启动期间从 IPSec 筛选中免除的数据包的源端口号。值为 0 意味着免除任何源端口。 </dd></dl><dl><dt><strong><em>dstport</em><strong>=</strong><em>Port</em></strong> </dt><dd>指定要在计算机启动期间从 IPSec 筛选中免除的数据包的目标端口号。值为 0 意味着免除任何目标端口。</dd></dl><dl><dt><strong><em>direction</em><strong>=</strong>{ <strong>inbound </strong>| <strong>outbound</strong>} </strong></dt><dd>指定要在计算机启动期间从 IPSec 筛选中免除的通讯的方向。</dd></dl></dd></dl></dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>如果 CRL 分发点必须能够通过网络访问到，并且只能在没有发生 CRL 检查错误的情况下验证证书，则使用强 CRL 检查（设置 <strong>property=strongcrlcheck value=2</strong>）。 <br />
    <br />
    &nbsp;</li>
    <li>如果 IPSec 策略不使用 Kerberos 作为身份验证方法，则 IPSec 只能协商 Kerberos 通讯的安全关联。如果身份验证必须使用 Kerberos，则必须通过使用 <strong>ipsecexempt</strong> 参数来免除 Kerberos 通讯。<br />
    <br />
    &nbsp;</li>
    <li>在 Windows 2000 和 Windows&nbsp;XP 中，默认情况下，IPSec 筛选会免除所有的广播、多播、Internet 密钥交换 (IKE)、Kerberos 和资源保留协议 (RSVP) 通讯。在 Windows&nbsp;Server&trade;&nbsp;2003 家族中，默认情况下，IPSec 筛选只免除 IKE 通讯。现在 IPSec 筛选器会对所有其他通讯类型进行匹配，您可以专门为多播和广播通讯配置阻止或允许筛选器操作（IPSec 并不为多播和广播通讯进行安全关联协商）。 <br />
    <br />
    该更改会影响到 IPSec 的默认行为，应当验证为 Windows 2000 或 Windows&nbsp;XP 而设计的 IPSec 策略的行为，并确定是否配置显式的允许筛选器来允许特定的通讯类型。若要恢复 Windows 2000 和 Windows&nbsp;XP 中 IPSec 策略的默认行为，请编辑下列注册表项：<strong>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IPSec</strong>。添加名为 <strong>NoDefaultExempt</strong> 的新 DWORD 值，并对它赋值为 <strong>0</strong>。有关向注册表项中添加值的详细信息，请参阅<a id="ctl00_mainContentContainer_ctl04" onclick="javascript:Track('ctl00_mainContentContainer_ctl00|ctl00_mainContentContainer_ctl04',this);" href="http://technet.microsoft.com/zh-cn/library/cc739561.aspx"><font color="#0033cc">向注册表项添加值</font></a>。<br />
    <br />
    &nbsp;</li>
</ul>
<p><strong>警告</strong></p>
<ul>
    <li>编辑注册表不当可能会严重损坏您的系统。在更改注册表之前，应备份计算机上任何有价值的数据。<br />
    <br />
    &nbsp;</li>
    <li>修改启动安全中的 IPSec 通讯免除（即修改参数 <strong>bootexemptions=</strong>）将覆盖启动安全中的所有以前的免除。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">set mmpolicy</h4>
<div class="subSection">
<p>修改 IPSec 主模式策略并将更改写入 SPD。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>set mmpolicy</strong><strong>name=</strong> [<strong>qmperm=</strong>][<strong>mmlifetime=</strong>][<strong>softsaexpirationtime=</strong>][<strong>mmsecmethods=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em></strong> </dt><dd>必需。指定要修改的 IPSec 主模式策略的名称。</dd></dl><dl><dt><strong>[ <strong>qmpermm=</strong><em>Integer</em>] </strong></dt><dd>指定使用主密钥材料派生出会话密钥的次数。值为 0 意味着可以从主模式 SA 派生出无数次的快速模式 SA。</dd></dl><dl><dt><strong>[ <strong>mmlifetime=</strong><em>Integer</em>] </strong></dt><dd>指定生成新主密钥所需的分钟数。</dd></dl><dl><dt><strong>[ <strong>softsaexpirationtime=</strong><em>Integer</em>] </strong></dt><dd>指定未受保护的安全关联存活的分钟数。</dd></dl><dl><dt><strong>[ <strong>mmsecmethods=&quot;</strong><em>SecMeth1SecMeth2</em><strong>&quot;</strong>] </strong></dt><dd>指定一个或多个密钥交换安全方法，这些方法由空格分隔并按下列格式定义：<em>ConfAlg</em>-<em>HashAlg</em>-<em>GroupNumb</em>，其中： <dl><dt><strong><em>ConfAlg</em></strong> </dt><dd>指定加密算法。<em>ConfAlg</em> 可以是 <strong>DES </strong>或 <strong>3DES</strong>。</dd></dl><dl><dt><strong><em>HashAlg</em></strong> </dt><dd>指定哈希函数。<em>HashAlg</em> 可以是 <strong>MD5</strong> 或 <strong>SHA1</strong>。</dd></dl><dl><dt><strong><em>GroupNum</em></strong> </dt><dd>指定用于基本密钥材料的 Diffie-Hellman 组。<em>GroupNumb</em> 可以为：<strong>1</strong>（低，使用 768 位密钥材料保护），<strong>2</strong>（中等，使用 1024 位保护）以及 <strong>3</strong>（高，使用 2048 位保护）。 </dd></dl></dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>IPSec 双方都必须具有至少一个通用的密钥交换安全措施（使用相同设置的措施），否则协商将会失败。 <br />
    <br />
    &nbsp;</li>
    <li>在主模式生存期内，如果快速模式协商数超过按照主模式协商为快速模式协商数设置的值，将发生新的主模式协商。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">set qmpolicy</h4>
<div class="subSection">
<p>修改 IPSec 快速模式策略，并将更改写入 SPD。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>set qmpolicy</strong><strong>name=</strong> [<strong>soft=</strong>][<strong>pfsgroup=</strong>][<strong>qmsecmethods=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em></strong> </dt><dd>必需。指定快速模式策略的名称。</dd></dl><dl><dt><strong>[ <strong>soft=</strong>{<strong>yes</strong> | <strong>no</strong>}] </strong></dt><dd>指定当其他计算机不支持 IPSec 时，或者与具有 IPSec 功能的计算机进行 IPSec 协商失败时，是否重新使用不安全的通讯。</dd></dl><dl><dt><strong>[ <strong>pfsgroup=</strong>{<strong>grp1</strong> | <strong>grp2</strong> | <strong>grp3</strong> |<strong> grpmm</strong> | <strong>nopfs</strong>}] </strong></dt><dd>指定用于会话密钥 PFS 的 Diffie-Hellman 组。如果指定 <strong>grp1</strong>，则使用&ldquo;组 1&rdquo;（低）。如果指定 <strong>grp2</strong>，则使用&ldquo;组 2&rdquo;（中）。如果指定 <strong>grp3</strong>，则使用&ldquo;组 2048&rdquo;（高）。如果指定 <strong>grpmm</strong>，则从当前主模式设置中提取组值。值为 <strong>nopfs</strong> 表示禁用会话密钥 PFS。</dd></dl><dl><dt><strong>[ <strong>qmsecmethods=&quot;</strong><em>Neg1Neg2</em><strong>&quot;</strong>] </strong></dt><dd>指定一个或多个安全措施，这些措施以空格分隔并按下列格式定义：{<strong>ESP</strong> [<em>ConfAlg</em>,<em>AuthAlg</em>]<strong>:</strong><em>k</em>/<em>s</em> | <strong>AH</strong> [<em>HashAlg</em>]<strong>:</strong><em>k/s</em> | <strong>AH</strong> [<em>HashAlg</em>+<strong>ESP</strong><em>ConfAlg</em>,<em>AuthAlg</em>]<strong>:</strong><em>k</em>/<em>s</em>}] 其中： <dl><dt><strong><em>ConfAlg</em></strong> </dt><dd>指定加密算法。<em>ConfigAlg</em> 可以是 <strong>DES</strong>（数据加密标准）、<strong>3DES</strong> 或<strong>无</strong>。 </dd></dl><dl><dt><strong><em>AuthAlg</em></strong> </dt><dd>指定完整性算法。<em>AuthAlg</em> 可以是 <strong>MD5</strong>（消息摘要 5）、<strong>SHA1</strong>（安全哈希算法 1）或<strong>无</strong>。</dd></dl><dl><dt><strong><em>HashAlg</em></strong> </dt><dd>指定哈希函数。<em>HashAlg</em> 可以是 <strong>MD5</strong> 或 <strong>SHA1</strong>。</dd></dl><dl><dt><strong><em>k</em></strong> </dt><dd>指定以千字节为单位的会话密钥生命周期。传输了指定千字节的数据后，会为快速模式 SA 生成新的会话密钥。默认值为 100000 千字节。</dd></dl><dl><dt><strong><em>s</em></strong> </dt><dd>指定以秒为单位的会话密钥生命周期。默认值是 3600 秒。</dd></dl></dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>在命令中指定的每个快速模式安全措施的顺序决定了该安全措施的首选顺序。<br />
    <br />
    &nbsp;</li>
    <li>IPSec 双方必须启用相同的 <strong>pfsgroup</strong>（就是说，通讯双方都必须将相同的 Diffie-Hellman 组用于会话密钥 PFS），否则通讯将失败。 <br />
    <br />
    &nbsp;</li>
    <li>为了获得增强的安全性，请不要使用 Diffie-Hellman&ldquo;组 1&rdquo;。为获得最佳安全性，请尽可能使用&ldquo;组 2048&rdquo;。当需要保证与 Windows&nbsp;2000 和 Windows&nbsp;XP 的互操作性时，请使用组 2。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">set rule</h4>
<div class="subSection">
<p>修改用来定义一组筛选器的 IPSec 规则，并将更改写入 SPD。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>set rule</strong><strong>srcaddr=</strong><strong>dstaddr=</strong><strong>protocol=</strong><strong>srcport=</strong><strong>dstport=</strong><strong>mirrored=</strong><strong>conntype=</strong> [<strong>srcmask=</strong>][<strong>dstmask=</strong>][<strong>tunneldstaddress=</strong>][<strong>mmpolicy=</strong>][<strong>qmpolicy=</strong>][<strong>actioninbound=</strong>][<strong>actionoutbound=</strong>][<strong>kerberos=</strong>][<strong>psk=</strong>][<strong>rootca=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>srcaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> | <em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>} </strong></dt><dd>必需。指定 IP 通讯的源 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong><strong>dstaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> |<em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>} </strong></dt><dd>必需。指定 IP 通讯的目标 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong><strong>protocol=</strong>{<strong>ANY</strong> | <strong>ICMP</strong> |<strong>TCP</strong>| <strong>UDP</strong> | <strong>RAW</strong> | <em>Integer </em>} </strong></dt><dd>必需。指定用于筛选器的 IP 协议。</dd></dl><dl><dt><strong><strong>srcport=</strong><em>Port</em></strong> </dt><dd>必需。指定当前被筛选数据包的源端口号。该选项仅适用于筛选 TCP 或 UDP 数据包。值 <strong>0 </strong>表示与源端口设置为 <strong>0</strong> 或 <strong>any</strong> 的筛选器匹配。</dd></dl><dl><dt><strong><strong>dstport=</strong><em>Port</em></strong> </dt><dd>必需。指定当前被筛选数据包的目标端口号。该选项仅适用于筛选 TCP 或 UDP 数据包。值 <strong>0 </strong>表示与目标端口设置为 <strong>0</strong> 或 <strong>any</strong> 的筛选器匹配。</dd></dl><dl><dt><strong><strong>mirrored=</strong>{<strong>yes</strong> | <strong>no</strong>} </strong></dt><dd>必需。指定是否使用镜像的筛选器创建了规则。</dd></dl><dl><dt><strong><strong>conntype=</strong>{<strong>lan</strong> | <strong>dialup</strong> | <strong>all</strong>} </strong></dt><dd>必需。指定该规则是仅应用于远程访问、拨号连接或局域网 (LAN) 连接，还是应用于所有连接。</dd></dl><dl><dt><strong>[ <strong>srcmask=</strong>{<em>Mask</em> | <em>Prefix</em>}] </strong></dt><dd>指定当前被筛选数据包的源地址子网掩码或前缀。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>dstmask=</strong>{<em>Mask</em> | <em>Prefix</em>}] </strong></dt><dd>指定当前被筛选数据包的目标地址子网掩码或前缀值。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>tunneldstaddress=</strong>{<em>IPAddress</em> | <em>DNSName</em>}] </strong></dt><dd>指定是否使用隧道技术进行通讯，如果允许，则指定隧道目标（隧道另一端的计算机或网关）的 IP 地址或 DNS 名称。</dd></dl><dl><dt><strong>[ <strong>mmpolicy=</strong><em>字符串</em>] </strong></dt><dd>指定主模式策略的名称。</dd></dl><dl><dt><strong>[ <strong>qmpolicy=</strong><em>字符串</em>] </strong></dt><dd>指定快速模式策略的名称。</dd></dl><dl><dt><strong>[ <strong>actioninbound=</strong>{<strong>permit</strong> | <strong>block</strong> | <strong>negotiate</strong>}] </strong></dt><dd>指定 IPSec 要为入站通讯执行的操作。如果指定 <strong>permit</strong>，则可在不协商或不应用 IP 安全的情况下，接收通讯。如果指定 <strong>block</strong>，则通讯将被阻止。如果指定 <strong>negotiate</strong>，将使用 IP 安全，并使用在主模式和快速模式策略中指定的安全方法列表。</dd></dl><dl><dt><strong>[ <strong>actionoutbound=</strong>{<strong>permit</strong> | <strong>block</strong> | <strong>negotiate</strong>}] </strong></dt><dd>指定 IPSec 要为出站通讯执行的操作。如果指定 <strong>permit</strong>，则可在不协商或不应用 IP 安全的情况下，发送通讯。如果指定 <strong>block</strong>，则通讯将被阻止。如果指定 <strong>negotiate</strong>，将使用 IP 安全，并使用在主模式和快速模式策略中指定的安全方法列表。</dd></dl><dl><dt><strong>[ <strong>kerberos=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定是否将 Kerberos V5 协议作为身份验证方法。</dd></dl><dl><dt><strong>[ <strong>psk=</strong><em>字符串</em>] </strong></dt><dd>如果将预共享的密钥作为身份验证方法，则指定用于该预共享密钥的字符串。</dd></dl><dl><dt><strong>[ <strong>rootca=&quot;</strong><em>String</em><strong>certmap:</strong>{<strong>yes</strong>| <strong>no</strong>} <strong>excludecaname:</strong>{<strong>yes</strong>| <strong>no</strong>} <strong>&quot;</strong>] </strong></dt><dd>指定证书身份验证选项，其中： <dl><dt><strong><em>String </em></strong></dt><dd>如果将证书作为身份验证方法，则指定该证书的可分辨名称。</dd></dl><dl><dt><strong><strong>certmap:</strong>{<strong>yes</strong>|<strong>no</strong>} </strong></dt><dd>指定是否启用证书到帐户的映射。可以启用证书到帐户映射，以验证证书是否正在被受信任的计算机使用。</dd></dl><dl><dt><strong><strong>excludecaname:</strong>{<strong>yes</strong>|<strong>no</strong>} </strong></dt><dd>指定是否从证书申请中排除受信任的根 CA 名称列表（从中接受证书）。 </dd></dl></dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>可以修改下列参数：<strong>mmpolicy=</strong>、<strong>qmpolicy=</strong>、<strong>actioninbound=</strong> 和 <strong>actionoutbound=</strong>。其他所有参数均用于标识想要修改的规则，因此不能修改它们。<br />
    <br />
    &nbsp;</li>
    <li>如果入站和出站通讯的筛选器操作（<strong>actioninbound</strong> 和 <strong>actionoutbound</strong>）设置为 <strong>Permit</strong> 或 <strong>Block</strong>，则不要求快速模式筛选器。<br />
    <br />
    &nbsp;</li>
    <li>如果指定了隧道规则，则应当将 <strong>mirror</strong> 设置为 <strong>no</strong>（<strong>mirror</strong> 的默认设置为 <strong>yes</strong>）。进行隧道操作时，必须手动创建下面两个规则：其中一个规则描述通过隧道发出的通讯（出站通讯），另一个规则描述通过隧道接收的通讯（入站通讯）。然后创建两个规则，这些规则使用策略中的入站与出站筛选器列表。<br />
    <br />
    &nbsp;</li>
    <li>要筛选进出特定计算机的任何数据包，可以使用 <strong>srcaddr=Me</strong> 或 <strong>dstaddr=Me</strong>。<br />
    <br />
    &nbsp;</li>
    <li>要筛选进出任何计算机的数据包，可以使用 <strong>srcaddr=Any</strong> 或 <strong>dstaddr=Any</strong>。<br />
    <br />
    &nbsp;</li>
    <li>对于作为 Active Directory 域成员的计算机，只能使用 Kerberos V5 身份验证或证书到帐户的映射。<br />
    <br />
    &nbsp;</li>
    <li>尽管只能使用一个预共享的密钥进行身份验证，但是如果为每个要使用的证书都指定一次 <strong>rootca</strong> 参数，则可以使用多个证书。<br />
    <br />
    &nbsp;</li>
    <li>所有的证书身份验证参数都必须包含在引号中。嵌入式引号标记必须用后面跟撇号的反斜杠替换 (\')。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
    <li>在命令中为每个身份验证方法指定的顺序决定了该方法的首选顺序。<br />
    <br />
    &nbsp;</li>
    <li>如果未指定身份验证方法，则使用动态的默认值。默认情况下，IPSec 策略使用 Kerberos V5 身份验证。如果该计算机具有计算机证书，则与该计算机证书链接的任意根 CA 也可用作身份验证。<br />
    <br />
    &nbsp;</li>
    <li>如果指定了 <strong>excludecaname:yes</strong>，则受信任的根 CA 的列表不作为证书申请的一部分被发送，从而杜绝了有关计算机信任关系的敏感信息泄漏的可能性。要增强连接到 Internet 的计算机的安全性，请指定该选项。<br />
    <br />
    &nbsp;</li>
    <li>不推荐使用预共享密钥身份验证方法，因为相对来说它是一种比较弱的身份验证方法。此外，预共享密钥以明文方式存储。<br />
    <br />
    &nbsp;</li>
    <li>IPSec 双方都必须有至少一个通用身份验证方法，否则通讯将失败。 <br />
    <br />
    &nbsp;</li>
    <li>修改身份认证方法将会覆盖所有以前的身份认证方法，即使以前的身份认证方法有所不同。例如，如果已指定了 <strong>kerberos=yes</strong> 和 <strong>psk=yes</strong>，而后又指定了 <strong>kerberos=no</strong>，则 <strong>psk=yes</strong> 参数也将被覆盖，而且不再使用预共享的密钥身份验证。<br />
    <br />
    &nbsp;</li>
</ul>
</div>
</div>
<h4 class="subHeading">show all</h4>
<div class="subSection">
<p>显示 SPD 中所有 IPSec 策略、筛选器、统计数据和安全关联的配置信息。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show all</strong> [<strong>resolvedns=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong>[ <strong>resolvedns=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定当显示源和目标时是否解析与 IP 地址相关的域名系统 (DNS) 或 NETBIOS 计算机名称。 </dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>由于 <strong>show all</strong> 命令可能会产生冗长和快速滚动的输出，所以可以考虑将输出保存在一个文本文件中，除非您仅需查看有限的部分。 <br />
    <br />
    要将 <strong>show all</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一：<br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec dynamic show all</strong><br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>netsh ipsec dynamic show all &gt;</strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>要停止输出 IPSec 配置信息，必须通过执行以下操作之一退出 <strong>Netsh</strong>： <br />
    <br />
    <ul>
        <li>单击 <strong>Netsh</strong> 窗口右上角的&ldquo;X&rdquo;图标关闭该窗口。<br />
        <br />
        &nbsp;</li>
        <li>使用&ldquo;任务管理器&rdquo;结束 <strong>Netsh</strong> 程序。 <br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
<h4 class="subHeading">show config</h4>
<div class="subSection">
<p>显示下列 IPSec 设置的值：IPSec 诊断、默认的通讯免除、证书吊销列表 (CRL) 强制检测、IKE (Oakley) 日志记录、日志记录间隔、计算机启动安全以及计算机启动通讯免除。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show config</strong></p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection">
<p>无。</p>
</div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>要将 <strong>show config</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一： <br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec dynamic show config</strong><br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>netsh ipsec dynamic show config &gt;</strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
<h4 class="subHeading">show mmfilter</h4>
<div class="subSection">
<p>显示 SPD 中指定 IPSec 主模式筛选器，或所有 IPSec 主模式筛选器的配置信息。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show mmfilter</strong><strong>name=</strong> | <strong>all</strong> [<strong>type=</strong>] <strong>srcaddr=dstadd=</strong> [<strong>srcmask=</strong>][<strong>dstmask=</strong>] [<strong>resolvedns=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>all</strong></strong> </dt><dd>必需。指定要显示的 IPSec 主模式筛选器的名称。或者，如果指定 <strong>all</strong>，则显示所有 IPSec 主模式筛选器。 </dd></dl><dl><dt><strong><strong>type=</strong>{<strong>generic</strong> | <strong>specific</strong>} </strong></dt><dd>指定是否显示一般的或指定的主模式筛选器。默认值为 <strong>generic</strong>。</dd></dl><dl><dt><strong>[ <strong>srcaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> |<em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>}] </strong></dt><dd>指定当前被筛选的 IP 通讯的源 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong>[ <strong>dstaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> | <em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>}] </strong></dt><dd>指定当前被筛选的 IP 通讯的目标 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong>[ <strong>srcmask=</strong>{<em>Mask</em> | <em>Prefix</em>}] </strong></dt><dd>指定当前被筛选数据包的源地址子网掩码或前缀。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>dstmask=</strong>{<em>Mask</em> | <em>Prefix</em>}] </strong></dt><dd>指定当前被筛选数据包的目标地址子网掩码或前缀值。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>resolvedns=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定当显示源和目标时是否解析与 IP 地址相关的域名系统 (DNS) 或 NETBIOS 计算机名称。默认值为 <strong>no</strong>。 </dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
    <li>由于 <strong>show mmfilter</strong> 命令可能会产生冗长和快速滚动的输出，所以可以考虑将输出保存在一个文本文件中，除非您仅需查看有限的部分。 <br />
    <br />
    要将 <strong>show mmfilter</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一：<br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec dynamic show mmfilter</strong><em>Name</em> | <strong>all</strong><br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>ipsec dynamic show mmfilter</strong><em>Name</em> | <strong>all &gt;=</strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>要停止输出 IPSec 配置信息，必须通过执行以下操作之一退出 <strong>Netsh</strong>： <br />
    <br />
    <ul>
        <li>单击 <strong>Netsh</strong> 窗口右上角的&ldquo;X&rdquo;图标关闭该窗口。<br />
        <br />
        &nbsp;</li>
        <li>使用&ldquo;任务管理器&rdquo;结束 <strong>Netsh</strong> 程序。 <br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
<h4 class="subHeading">show mmpolicy</h4>
<div class="subSection">
<p>显示 SPD 中指定的 IPSec 主模式策略，或所有 IPSec 主模式策略的配置信息。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show mmpolicy</strong><strong>name=</strong> | <strong>all</strong></p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>all</strong></strong> </dt><dd>必需。指定要显示的 IPSec 主模式策略的名称。或者，如果指定 <strong>all</strong>，则显示所有 IPSec 主模式策略。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
    <li>由于 <strong>show mmpolicy</strong> 命令可能会产生冗长和快速滚动的输出，所以可以考虑将输出保存在一个文本文件中，除非您仅需查看有限的部分。 <br />
    <br />
    要将 <strong>show mmpolicy</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一：<br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec dynamic show mmpolicy</strong><em>Name</em> | <strong>all</strong><br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>ipsec dynamic show mmpolicy</strong><em>Name</em> | <strong>all &gt;</strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>要停止输出 IPSec 配置信息，必须通过执行以下操作之一退出 <strong>Netsh</strong>： <br />
    <br />
    <ul>
        <li>单击 <strong>Netsh</strong> 窗口右上角的&ldquo;X&rdquo;图标关闭该窗口。<br />
        <br />
        &nbsp;</li>
        <li>使用&ldquo;任务管理器&rdquo;结束 <strong>Netsh</strong> 程序。 <br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
<h4 class="subHeading">show mmsas</h4>
<div class="subSection">
<p>显示 SPD 中指定的源和目标地址的 IPSec 主模式安全关联，或所有 IPSec 主模式安全关联。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show mmsas</strong> [<strong>all</strong>] [<strong>srcaddr=</strong>][<strong>dstaddr=</strong>][<strong>format=</strong>] [<strong>resolvedns=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong>[ <strong>all</strong>] </strong></dt><dd>指定显示所有主模式安全关联。</dd></dl><dl><dt><strong>[ <strong>srcaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> |<em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>}] </strong></dt><dd>指定当前被筛选的 IP 通讯的源 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong>[ <strong>dstaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> | <em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>}] </strong></dt><dd>指定当前被筛选的 IP 通讯的目标 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong>[ <strong>format=</strong>{<strong>list</strong> | <strong>table</strong>}] </strong></dt><dd>指定以屏幕格式还是以制表符分隔的格式显示 IPSec 配置信息。默认值为 <strong>list</strong>，表示以屏幕格式显示输出。 </dd></dl><dl><dt><strong>[ <strong>resolvedns=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定当显示源和目标时是否解析与 IP 地址相关的域名系统 (DNS) 或 NETBIOS 计算机名称。默认值为 <strong>no</strong>。 </dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>如果没有指定参数，将显示所有主模式安全关联。<br />
    <br />
    &nbsp;</li>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
    <li>由于 <strong>show mmsas</strong> 命令可能会产生冗长和快速滚动的输出，所以可以考虑将输出保存在一个文本文件中，除非您仅需查看有限的部分。 <br />
    <br />
    要将 <strong>show mmsas</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一：<br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec dynamic show mmsas</strong><br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>netsh ipsec dynamic show mmsas &gt;</strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>要停止输出 IPSec 配置信息，必须通过执行以下操作之一退出 <strong>Netsh</strong>： <br />
    <br />
    <ul>
        <li>单击 <strong>Netsh</strong> 窗口右上角的&ldquo;X&rdquo;图标关闭该窗口。<br />
        <br />
        &nbsp;</li>
        <li>使用&ldquo;任务管理器&rdquo;结束 <strong>Netsh</strong> 程序。 <br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
<h4 class="subHeading">show qmfilter</h4>
<div class="subSection">
<p>显示 SPD 中指定快速模式筛选器的配置信息，或所有快速模式筛选器的配置信息。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show qmfilter</strong><strong>name=</strong> | <strong>all</strong> [<strong>type=</strong>] [<strong>srcaddr=</strong>][<strong>dstaddr=</strong>][<strong>srcmask=</strong>][<strong>dstmask=</strong>][<strong>protocol=</strong>][<strong>srcport=</strong>][<strong>dstport=</strong>][<strong>actioninbound=</strong>][<strong>actionoutbound=</strong>][<strong>resolvedns=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>all</strong></strong> </dt><dd>必需。指定要显示的 IPSec 快速模式筛选器的名称，或者，如果指定 <strong>all</strong>，则显示所有 IPSec 快速模式筛选器。 </dd></dl><dl><dt><strong>[ <strong>type=</strong>{<strong>generic</strong> | <strong>specific</strong>}] </strong></dt><dd>指定是否显示一般的或指定的快速模式筛选器。默认值为 <strong>generic</strong>。</dd></dl><dl><dt><strong>[ <strong>srcaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> |<em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>}] </strong></dt><dd>指定当前被筛选的 IP 通讯的源 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong>[ <strong>dstaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> | <em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>}] </strong></dt><dd>指定当前被筛选的 IP 通讯的目标 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong>[ <strong>srcmask=</strong>{<em>Mask</em> | <em>Prefix</em>}] </strong></dt><dd>指定当前被筛选数据包的源地址子网掩码或前缀。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>dstmask=</strong>{<em>Mask</em> | <em>Prefix</em>}] </strong></dt><dd>指定当前被筛选数据包的目标地址子网掩码或前缀值。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>protocol=</strong>{<strong>ANY</strong> | <strong>ICMP</strong> |<strong>TCP</strong>| <strong>UDP</strong> | <strong>RAW</strong> | <em>Integer </em>}] </strong></dt><dd>除了寻址信息外，如果筛选某个特定的 IP 协议，则指定该 IP 协议。默认值为 <strong>ANY</strong>，表示该筛选器可以使用所有协议。</dd></dl><dl><dt><strong>[ <strong>srcport=</strong><em>Port</em>] </strong></dt><dd>指定当前被筛选数据包的源端口号。该选项仅适用于筛选 TCP 或 UDP 数据包。如果指定为 0，则来自任何端口的数据包都将被筛选。默认设置为任意值。</dd></dl><dl><dt><strong>[ <strong>dstport=</strong><em>Port</em>] </strong></dt><dd>指定当前被筛选数据包的目标端口号。该选项仅适用于筛选 TCP 或 UDP 数据包。如果指定为 0，则发送到任何端口的数据包都将被筛选。默认设置为任意值。</dd></dl><dl><dt><strong>[ <strong>actioninbound=</strong>{<strong>permit</strong> | <strong>block</strong> | <strong>negotiate</strong>}] </strong></dt><dd>指定 IPSec 要为入站通讯执行的操作。默认值为 <strong>negotiate</strong>。</dd></dl><dl><dt><strong>[ <strong>actionoutbound=</strong>{<strong>permit</strong> | <strong>block</strong> | <strong>negotiate</strong>}] </strong></dt><dd>指定 IPSec 要为出站通讯执行的操作。默认值为 <strong>negotiate</strong>。</dd></dl><dl><dt><strong>[ <strong>resolvedns=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定当显示源和目标时是否解析与 IP 地址相关的域名系统 (DNS) 或 NETBIOS 计算机名称。默认值为 <strong>no</strong>。 </dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
    <li>由于 <strong>show qmfilter</strong> 命令可能会产生冗长和快速滚动的输出，所以可以考虑将输出保存在一个文本文件中，除非您仅需查看有限的部分。 <br />
    <br />
    要将 <strong>show qmfilter</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一：<br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec dynamic show qmfilter </strong><em>Name</em> | <strong>all</strong><br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>netsh ipsec dynamic show qmfilter </strong><em>Name</em> | <strong>all</strong> &gt;<em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>要停止输出 IPSec 配置信息，必须通过执行以下操作之一退出 <strong>Netsh</strong>： <br />
    <br />
    <ul>
        <li>单击 <strong>Netsh</strong> 窗口右上角的&ldquo;X&rdquo;图标关闭该窗口。<br />
        <br />
        &nbsp;</li>
        <li>使用&ldquo;任务管理器&rdquo;结束 <strong>Netsh</strong> 程序。 <br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
<h4 class="subHeading">show qmpolicy</h4>
<div class="subSection">
<p>显示 SPD 中指定 IPSec 快速模式策略的配置信息，或所有 IPSec 快速模式策略的配置信息。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show qmpolicy</strong><strong>name=</strong> | <strong>all</strong></p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong><strong>name=</strong><em>字符串</em>| <strong>all</strong></strong> </dt><dd>必需。指定要显示的 IPSec 快速模式策略的名称。或者，如果指定 <strong>all</strong>，则显示所有 IPSec 快速模式策略。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
    <li>由于 <strong>show qmpolicy</strong> 命令可能会产生冗长和快速滚动的输出，所以可以考虑将输出保存在一个文本文件中，除非您仅需查看有限的部分。 <br />
    <br />
    要将 <strong>show qmpolicy</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一：<br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec dynamic show qmpolicy</strong><em>Name</em> | <strong>all</strong><br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>netsh ipsec dynamic show qmpolicy</strong><em>Name</em> | <strong>all</strong> &gt;<em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>要停止输出 IPSec 配置信息，必须通过执行以下操作之一退出 <strong>Netsh</strong>： <br />
    <br />
    <ul>
        <li>单击 <strong>Netsh</strong> 窗口右上角的&ldquo;X&rdquo;图标关闭该窗口。<br />
        <br />
        &nbsp;</li>
        <li>使用&ldquo;任务管理器&rdquo;结束 <strong>Netsh</strong> 程序。 <br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
<h4 class="subHeading">show qmsas</h4>
<div class="subSection">
<p>显示 SPD 中指定源和目标地址的 IPSec 快速模式安全关联，或所有 IPSec 快速模式安全关联。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show qmsas</strong> [<strong>all</strong>][<strong>srcaddr=</strong>][<strong>dstaddr=</strong>][<strong>protocol=</strong>][<strong>format=</strong>][<strong>resolvedns=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong>[ <strong>all</strong>] </strong></dt><dd>指定显示所有 IPSec 快速模式安全关联。</dd></dl><dl><dt><strong>[ <strong>srcaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> |<em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>}] </strong></dt><dd>指定当前被筛选的 IP 通讯的源 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong>[ <strong>dstaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> |<em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>] </strong></dt><dd>指定当前被筛选的 IP 通讯的目标 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong>[ <strong>protocol=</strong>{<strong>ANY</strong> | <strong>ICMP</strong> |<strong>TCP</strong>| <strong>UDP</strong> | <strong>RAW</strong> | <em>Integer </em>}] </strong></dt><dd>除了寻址信息外，如果某个特定的 IP 协议用于安全关联，则指定该 IP 协议。默认值为 <strong>ANY</strong>，表示安全关联可以使用所有协议。</dd></dl><dl><dt><strong>[ <strong>format=</strong>{<strong>list</strong> | <strong>table</strong>}] </strong></dt><dd>指定以屏幕格式还是以制表符分隔的格式显示 IPSec 配置信息。默认值为 <strong>list</strong>，表示以屏幕格式显示输出。 </dd></dl><dl><dt><strong>[ <strong>resolvedns=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定当显示源和目标时是否解析与 IP 地址相关的域名系统 (DNS) 或 NETBIOS 计算机名称。默认值为 <strong>no</strong>。 </dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>由于 <strong>show qmsas</strong> 命令可能会产生冗长和快速滚动的输出，所以可以考虑将输出保存在一个文本文件中，除非您仅需查看有限的部分。 <br />
    <br />
    要将 <strong>show qmsas</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一：<br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec dynamic show qmsas all </strong><br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>netsh ipsec dynamic show qmsas all &gt;</strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>要停止输出 IPSec 配置信息，必须通过执行以下操作之一退出 <strong>Netsh</strong>： <br />
    <br />
    <ul>
        <li>单击 <strong>Netsh</strong> 窗口右上角的&ldquo;X&rdquo;图标关闭该窗口。<br />
        <br />
        &nbsp;</li>
        <li>使用&ldquo;任务管理器&rdquo;结束 <strong>Netsh</strong> 程序。 <br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
<h4 class="subHeading">show rule</h4>
<div class="subSection">
<p>显示 SPD 中一个或多个 IPSec 规则的配置信息。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show rule</strong> [<strong>type=</strong>][<strong>srcaddr=</strong>] [<strong>dstaddr=</strong>][<strong>srcmask=</strong>][<strong>dstmask=</strong>] [<strong>protocol=</strong>][<strong>srcport=</strong>][<strong>dstport=</strong>][<strong>actioninbound=</strong>][<strong>actionoutbound=</strong>][<strong>resolvedns=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong>[ <strong>type=</strong>{<strong>transport</strong> | <strong>tunnel</strong>}] </strong></dt><dd>指定是否显示传输规则或隧道规则。默认值是显示所有规则。</dd></dl><dl><dt><strong>[ <strong>srcaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> |<em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>}] </strong></dt><dd>指定当前被筛选的 IP 通讯的源 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong>[ <strong>dstaddr=</strong>{<strong>Me</strong> | <strong>Any</strong> | <em>IPAddress</em> | <em>DNSName</em> | <em>ServerType</em>}] </strong></dt><dd>指定当前被筛选的 IP 通讯的目标 IP 地址、DNS 名称或服务器类型。<em>ServerType</em> 可以使用 <strong>WINS</strong>、<strong>DNS</strong>、<strong>DHCP</strong> 或 <strong>gateway</strong>。</dd></dl><dl><dt><strong>[ <strong>srcmask=</strong>{<em>Mask</em> | <em>Prefix</em>}] </strong></dt><dd>指定当前被筛选数据包的源地址子网掩码或前缀。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>dstmask=</strong>{<em>Mask</em> | <em>Prefix</em>}] </strong></dt><dd>指定当前被筛选数据包的目标地址子网掩码或前缀值。可以指定从 1 到 32 这个范围内的前缀值，子网掩码的默认值为 255.255.255.255。</dd></dl><dl><dt><strong>[ <strong>protocol=</strong>{<strong>ANY</strong> | <strong>ICMP</strong> |<strong>TCP</strong>| <strong>UDP</strong> | <strong>RAW</strong> | <em>Integer </em>}] </strong></dt><dd>除了寻址信息外，如果某个特定的 IP 协议用于规则，则指定该 IP 协议。默认值为 <strong>ANY</strong>，表示该规则可以使用所有协议。</dd></dl><dl><dt><strong>[ <strong>srcport=</strong><em>Port</em>] </strong></dt><dd>指定当前被筛选数据包的源端口号。该选项仅适用于筛选 TCP 或 UDP 数据包。如果指定为 0，则来自任何端口的数据包都将被筛选。默认设置为任意值。</dd></dl><dl><dt><strong>[ <strong>dstport=</strong><em>Port</em>] </strong></dt><dd>指定当前被筛选数据包的目标端口号。该选项仅适用于筛选 TCP 或 UDP 数据包。如果指定为 0，则发送到任何端口的数据包都将被筛选。默认设置为任意值。</dd></dl><dl><dt><strong>[ <strong>actioninbound=</strong>{<strong>permit</strong> | <strong>block</strong> | <strong>negotiate</strong>}] </strong></dt><dd>指定 IPSec 要为入站通讯执行的操作。默认值为 <strong>negotiate</strong>。</dd></dl><dl><dt><strong>[ <strong>actionoutbound=</strong>{<strong>permit</strong> | <strong>block</strong> | <strong>negotiate</strong>}] </strong></dt><dd>指定 IPSec 要为出站通讯执行的操作。默认值为 <strong>negotiate</strong>。</dd></dl><dl><dt><strong>[ <strong>resolvedns=</strong>{<strong>yes </strong>| <strong>no</strong>}] </strong></dt><dd>指定当显示源和目标时是否解析与 IP 地址相关的域名系统 (DNS) 或 NETBIOS 计算机名称。默认值为 <strong>no</strong>。 </dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>所有字符串参数都区分大小写。<br />
    <br />
    &nbsp;</li>
    <li>由于 <strong>show rule</strong> 命令可能会产生冗长和快速滚动的输出，所以可以考虑将输出保存在一个文本文件中，除非您仅需查看有限的部分。 <br />
    <br />
    要将 <strong>show rule</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一：<br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec dynamic show rule</strong><br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>netsh ipsec dynamic show rule &gt;</strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>要停止输出 IPSec 配置信息，必须通过执行以下操作之一退出 <strong>Netsh</strong>： <br />
    <br />
    <ul>
        <li>单击 <strong>Netsh</strong> 窗口右上角的&ldquo;X&rdquo;图标关闭该窗口。<br />
        <br />
        &nbsp;</li>
        <li>使用&ldquo;任务管理器&rdquo;结束 <strong>Netsh</strong> 程序。 <br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
<h4 class="subHeading">show stats</h4>
<div class="subSection">
<p>显示 IPSec 的主模式和快速模式统计信息。</p>
<h4 class="subHeading">语法</h4>
<div class="subSection">
<p><strong>show stats</strong> [<strong>type=</strong>]</p>
</div>
<h4 class="subHeading">参数</h4>
<div class="subSection"><dl><dt><strong>[ <strong>type=all</strong>| <strong>ike</strong>| <strong>ipsec</strong>] </strong></dt><dd>指定要显示的 IPSec 统计信息。如果指定 <strong>all</strong>，将显示 IPSec 主模式和快速模式统计信息。如果指定 <strong>ike</strong>，只显示 IPSec 主模式统计信息。如果指定 <strong>ipsec</strong>，只显示 IPSec 快速模式统计信息。</dd></dl></div>
<h4 class="subHeading">注释</h4>
<div class="subSection">
<ul>
    <li>由于 <strong>show stats</strong> 命令可能会产生冗长和快速滚动的输出，所以可以考虑将输出保存在一个文本文件中，除非您仅需查看有限的部分。 <br />
    <br />
    要将 <strong>show stats</strong> 命令的输出保存在一个文本文件中，请执行以下操作之一：<br />
    <br />
    <strong>如果您在 netsh 环境中 (netsh&gt;)</strong><br />
    <br />
    <ol class="ordered">
        <li>在 netsh 提示符下，键入： <br />
        <br />
        <strong>set file open </strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
        <li>然后键入： <br />
        <br />
        <strong>ipsec dynamic show stats</strong><br />
        <br />
        &nbsp;</li>
        <li>要停止发送输出并关闭文件，请键入： <br />
        <br />
        <strong>set file close</strong><br />
        <br />
        &nbsp;</li>
    </ol>
    <strong>如果您不在 netsh 环境中</strong><br />
    <br />
    <ul>
        <li>在命令提示符下，键入： <br />
        <br />
        <strong>netsh ipsec dynamic show stats &gt;</strong><em>FileName</em>.txt<br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
    <li>要停止输出 IPSec 配置信息，必须通过执行以下操作之一退出 <strong>Netsh</strong>： <br />
    <br />
    <ul>
        <li>单击 <strong>Netsh</strong> 窗口右上角的&ldquo;X&rdquo;图标关闭该窗口。<br />
        <br />
        &nbsp;</li>
        <li>使用&ldquo;任务管理器&rdquo;结束 <strong>Netsh</strong> 程序。 <br />
        <br />
        &nbsp;</li>
    </ul>
    </li>
</ul>
</div>
</div>
</div>
</div>
<h2 class="heading">格式图例</h2>
<div id="sectionSection6" class="section">
<h3 class="subHeading">&nbsp;</h3>
<table>
    <tbody>
        <tr>
            <th>格式</th>
            <th>意义</th>
        </tr>
        <tr>
            <td>
            <p><em>斜体</em></p>
            </td>
            <td>
            <p>用户必须提供的信息</p>
            </td>
        </tr>
        <tr>
            <td>
            <p><strong>粗体</strong></p>
            </td>
            <td>
            <p>用户必须像显示的一样准确键入的元素</p>
            </td>
        </tr>
        <tr>
            <td>
            <p>省略号 (...)</p>
            </td>
            <td>
            <p>可在命令行中重复多次的参数</p>
            </td>
        </tr>
        <tr>
            <td>
            <p>在括号 ([]) 之间</p>
            </td>
            <td>
            <p>可选项目</p>
            </td>
        </tr>
        <tr>
            <td>
            <p>在大括号 ({}) 之间；将选项用管线 (|) 隔开。例如：{even|odd}</p>
            </td>
            <td>
            <p>用户必须从中只选择一个选项的选项组</p>
            </td>
        </tr>
        <tr>
            <td>
            <p><code>Courier font</code></p>
            </td>
            <td>
            <p>代码或程序输出</p>
            </td>
        </tr>
    </tbody>
</table>
</div>
</div>
</div>
<p>&nbsp;原文：<a href="http://technet.microsoft.com/zh-cn/library/cc739550.aspx">http://technet.microsoft.com/zh-cn/library/cc739550.aspx</a></p>
<p><br />
相关文档：<br />
&nbsp;</p>
<p>ipseccmd.exe说明<br />
<a href="http://www.anywolfs.com/liuhui/article.asp?id=417">http://www.anywolfs.com/liuhui/article.asp?id=417</a></p>
<p>&nbsp;</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.anywolfs.com/liuhui/article.asp?id=418" /> 
	  <id>http://www.anywolfs.com/liuhui/default.asp?id=418</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[ipseccmd.exe说明]]></title>
	  <author>
		 <name>jothui</name>
		 <uri>http://www.anywolfs.com/liuhui/</uri>
		 <email>jothui8@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://www.anywolfs.com/liuhui/default.asp?cateID=4" label="Security" /> 
	  <updated>2009-04-29T09:54:57+08:00</updated>
	  <published>2009-04-29T09:54:57+08:00</published>
		  <summary type="html"><![CDATA[<p>IPSec 策略可以在本地应用，也可以作为域的组策略的一部分应用于该域的成员。本地 IPSec 策略可以是<b>静态</b>的（重新启动后一直有效）或<b>动态</b>的（易失效）。静态 IPSec 策略被写入本地注册表并在操作系统重新启动后一直有效。动态 IPSec 策略没有被永久性地写入注册表，并且在操作系统或 IPSec Policy Agent 服务重新启动后被删除。<br />
<br />
<b>重要说明</b>：本文包含有关使用 Ipsecpol.exe 编辑注册表的信息。编辑注册表之前，一定要知道在发生问题时如何还原注册表。有关如何备份、还原和编辑注册表的信息，请单击下面的文章编号，以查看 Microsoft 知识库中相应的文章：</p>
<div class="indent"><a class="KBlink" href="http://support.microsoft.com/kb/256986/">256986</a>&nbsp; <span class="pLink">(http://support.microsoft.com/kb/256986/ ) </span>Microsoft Windows 注册表说明</div>
<p><b>注意</b>：IPSec 筛选规则会导致网络程序丢失数据和停止响应网络请求，包括无法对用户进行身份验证。只有当您清楚地了解阻止特定端口对您的环境具有的影响之后，才应将 IPSec 筛选规则作为一种迫不得已的防护措施加以采用。如果您按照本文列出的步骤创建的 IPSec 策略对您的网络程序有不利影响，请参阅本文稍后的&ldquo;取消指定和删除 IPSec 策略&rdquo;一节，了解有关如何立即禁用和删除该策略的说明。</p>
<div class="topOfPage">&nbsp;</div>
<h3 id="tocHeadRef">确定是否指定了 IPSec 策略</h3>
<script type="text/javascript">
                loadTOCNode(2, 'moreinformation');
            </script>
<h4 id="tocHeadRef">基于 Windows Server 2003 的计算机</h4>
<p><script type="text/javascript">
            loadTOCNode(3, 'moreinformation');
        </script>在为基于 Windows Server 2003 的计算机创建或指定任何新的 IPSec 策略之前，请确定是否有从本地注册表或通过组策略对象 (GPO) 应用的任何 IPSec 策略。为此，请按照下列步骤操作：</p>
<ol>
    <li>运行 Windows Server 2003 CD 上的 Support\Tools 文件夹中的 Suptools.msi，安装 Netdiag.exe。</li>
    <li>打开命令提示符窗口，然后将工作文件夹设置为 C:\Program Files\Support Tools。</li>
    <li>运行以下命令以验证尚未为该计算机指定现有 IPSec 策略：
    <div class="indent"><span class="userInput">netdiag /test:ipsec</span></div>
    如果没有指定策略，您将收到以下消息：
    <div class="message">IP 安全测试。. . . . . . . . : 传递的 IPSec 策略服务是活动的，但是没有指定策略。</div>
    </li>
</ol>
<h4 id="tocHeadRef">基于 Windows XP 的计算机</h4>
<p><script type="text/javascript">
            loadTOCNode(3, 'moreinformation');
        </script>在为基于 Windows XP 的计算机创建或指定任何新的 IPSec 策略之前，请确定是否有从本地注册表或通过 GPO 应用的任何 IPSec 策略。为此，请按照下列步骤操作：</p>
<ol>
    <li>运行 Windows XP CD 上的 Support\Tools 文件夹中的 Setup.exe，安装 Netdiag.exe。</li>
    <li>打开命令提示符窗口，然后将工作文件夹设置为 C:\Program Files\Support Tools。</li>
    <li>运行以下命令以验证尚未为该计算机指定现有 IPSec 策略：
    <div class="indent"><span class="userInput">netdiag /test:ipsec</span></div>
    如果没有指定策略，您将收到以下消息：
    <div class="message">IP 安全测试。. . . . . . . . : 传递的 IPSec 策略服务是活动的，但是没有指定策略。</div>
    </li>
</ol>
<h4 id="tocHeadRef">基于 Windows 2000 的计算机</h4>
<p><script type="text/javascript">
            loadTOCNode(3, 'moreinformation');
        </script>在为基于 Windows 2000 的计算机创建或指定任何新的 IPSec 策略之前，请确定是否有从本地注册表或通过 GPO 应用的任何 IPSec 策略。为此，请按照下列步骤操作：</p>
<ol>
    <li>运行 Windows 2000 CD 上的 Support\Tools 文件夹中的 Setup.exe，安装 Netdiag.exe。</li>
    <li>打开命令提示符窗口，然后将工作文件夹设置为 C:\Program Files\Support Tools。</li>
    <li>运行以下命令以验证尚未为该计算机指定现有 IPSec 策略：
    <div class="indent"><span class="userInput">netdiag /test:ipsec</span></div>
    如果没有指定策略，您将收到以下消息：
    <div class="message">IP 安全测试。. . . . . . . . : 传递的 IPSec 策略服务是活动的，但是没有指定策略。</div>
    </li>
</ol>
<div class="topOfPage">&nbsp;</div>
<h3 id="tocHeadRef">创建用于阻止通信的静态策略</h3>
<script type="text/javascript">
                loadTOCNode(2, 'moreinformation');
            </script>
<h4 id="tocHeadRef">基于 Windows Server 2003 和 Windows XP 的计算机</h4>
<p><script type="text/javascript">
            loadTOCNode(3, 'moreinformation');
        </script>对于没有启用本地定义的 IPSec 策略的系统，请创建一个新的本地静态策略，以阻止定向到 Windows Server 2003 和 Windows XP 计算机上的特定协议和特定端口的通信。为此，请按照下列步骤操作：</p>
<ol>
    <li>验证 IPSec Policy Agent 服务已在&ldquo;服务&rdquo;MMC 管理单元中启用并启动。</li>
    <li>安装 IPSeccmd.exe。IPSeccmd.exe 是 Windows XP Service Pack 2 (SP2) 支持工具的一部分。<br />
    <br />
    <b>注意</b>：IPSeccmd.exe 将在 Windows XP 和 Windows Server 2003 操作系统中运行，但仅有 Windows XP SP2 支持工具包中提供此工具。<br />
    <br />
    有关下载和安装 Windows XP Service Pack 2 支持工具的更多信息，请单击下面的文章编号，以查看 Microsoft 知识库中相应的文章：
    <div class="indent"><a class="KBlink" href="http://support.microsoft.com/kb/838079/">838079</a>&nbsp; <span class="pLink">(http://support.microsoft.com/kb/838079/ ) </span>Windows XP Service Pack 2 支持工具</div>
    </li>
    <li>打开命令提示符窗口，然后将工作文件夹设置为安装 Windows XP Service Pack 2 支持工具的文件夹。<br />
    <br />
    <b>注意</b>：Windows XP SP2 支持工具的默认文件夹是 C:\Program Files\Support Tools。</li>
    <li>要创建一个新的本地 IPSec 策略和筛选规则，并将其应用于从任何 IP 地址发送到您要配置的 Windows Server 2003 或 Windows XP 计算机的 IP 地址的网络通信，请使用以下命令。<br />
    <br />
    <b>注意</b>：在以下命令中，<var>Protocol</var> 和 <var>PortNumber</var> 是变量。
    <div class="indent"><span class="userInput">IPSeccmd.exe -w REG -p &quot;Block <var>Protocol</var><var>PortNumber</var> Filter&quot; -r &quot;Block Inbound <var>Protocol</var><var>PortNumber</var> Rule&quot; -f *=0:<var>PortNumber</var>:<var>Protocol</var> -n BLOCK &ndash;x</span></div>
    例如，要阻止从任何 IP 地址和任何源端口发往 Windows Server 2003 或 Windows XP 计算机上的目标端口 UDP 1434 的网络通信，请键入以下命令。此策略可以有效地保护运行 Microsoft SQL Server 2000 的计算机免遭&ldquo;Slammer&rdquo;蠕虫病毒的攻击。
    <div class="indent"><span class="userInput">IPSeccmd.exe -w REG -p &quot;Block UDP 1434 Filter&quot; -r &quot;Block Inbound UDP 1434 Rule&quot; -f *=0:1434:UDP -n BLOCK -x</span></div>
    以下示例可阻止对 TCP 端口 80 的入站访问，但是仍然允许出站 TCP 80 访问。此策略可以有效地保护运行 Microsoft Internet 信息服务 (IIS) 5.0 的计算机免遭&ldquo;Code Red&rdquo;蠕虫病毒和&ldquo;Nimda&rdquo;蠕虫病毒的攻击。
    <div class="indent"><span class="userInput">IPSeccmd.exe -w REG -p &quot;Block TCP 80 Filter&quot; -r &quot;Block Inbound TCP 80 Rule&quot; -f *=0:80:TCP -n BLOCK -x</span></div>
    <b>注意</b>：<span class="userInput">-x</span> 开关会立即指定该策略。如果您输入此命令，将取消指定&ldquo;Block UDP 1434 Filter&rdquo;策略，并指定&ldquo;Block TCP 80 Filter&rdquo;。要添加但不指定该策略，则在键入该命令时不要在结尾带 <span class="userInput">-x</span> 开关。</li>
    <li>要向现有的&ldquo;Block UDP 1434 Filter&rdquo;策略（阻止从基于 Windows Server 2003 或 Windows XP 的计算机发往任何 IP 地址的网络通信）添加其他筛选规则，请使用以下命令。<br />
    <br />
    <b>注意</b>：在此命令中，<var>Protocol</var> 和 <var>PortNumber</var> 是变量：
    <div class="indent"><span class="userInput">IPSeccmd.exe -w REG -p &quot;Block <var>Protocol</var><var>PortNumber</var> Filter&quot; -r &quot;Block Outbound <var>Protocol</var><var>PortNumber</var> Rule&quot; -f *0=:<var>PortNumber</var>:<var>Protocol</var> -n BLOCK</span></div>
    例如，要阻止从基于 Windows Server 2003 或 Windows XP 的计算机发往任何其他主机上的 UDP 1434 的任何网络通信，请键入以下命令。此策略可以有效地阻止运行 SQL Server 2000 的计算机传播&ldquo;Slammer&rdquo;蠕虫病毒。
    <div class="indent"><span class="userInput">IPSeccmd.exe -w REG -p &quot;Block UDP 1434 Filter&quot; -r &quot;Block Outbound UDP 1434 Rule&quot; -f 0=*:1434:UDP -n BLOCK</span></div>
    <b>注意</b>：您可以使用此命令向策略中添加任意数量的筛选规则。例如，可以使用此命令通过同一策略阻止多个端口。</li>
    <li>步骤 5 中的策略现在将生效，并将在每次重新启动计算机后都会生效。但是，如果以后为计算机指定了基于域的 IPSec 策略，此本地策略将被覆盖并将不再适用。<br />
    <br />
    要验证您的筛选规则是否已成功指定，请在命令提示符下将工作文件夹设置为 C:\Program Files\Support Tools，然后键入以下命令：
    <div class="indent"><span class="userInput">netdiag /test:ipsec /debug</span></div>
    正如这些示例中所示，如果同时指定了用于入站通信和出站通信的策略，您将收到以下消息：
    <div class="message">IP 安全测试。. . . . . . . . : <br />
    传递的本地 IPSec 策略活动:&ldquo;Block UDP 1434 Filter&rdquo;IP 安全策略路径:SOFTWARE\Policies\Microsoft\Windows\IPSec\Policy\Local\ipsecPolicy{D239C599-F945-47A3-A4E3-B37BC12826B9} <br />
    <br />
    有 2 个筛选<br />
    无名称<br />
    筛选 ID:{5EC1FD53-EA98-4C1B-A99F-6D2A0FF94592}<br />
    策略 ID:{509492EA-1214-4F50-BF43-9CAC2B538518}<br />
    源地址:0.0.0.0 源掩码:0.0.0.0 <br />
    目标地址:192.168.1.1 目标掩码:255.255.255.255 <br />
    隧道地址:0.0.0.0 源端口:0 目标端口:1434 <br />
    协议:17 TunnelFilter:无<br />
    标志:入站阻止<br />
    无名称<br />
    筛选 ID:{9B4144A6-774F-4AE5-B23A-51331E67BAB2}<br />
    策略 ID:{2DEB01BD-9830-4067-B58A-AADFC8659BE5}<br />
    源地址:192.168.1.1 源掩码:255.255.255.255 <br />
    目标地址:0.0.0.0 目标掩码:0.0.0.0 <br />
    隧道地址:0.0.0.0 源端口:0 目标端口:1434 <br />
    协议:17 TunnelFilter:无 <br />
    标志:出站阻止</div>
    <b>注意</b>：根据是基于 Windows Server 2003 还是基于 Windows XP 的计算机，IP 地址和图形用户界面 (GUID) 号会有所不同。</li>
</ol>
<h4 id="tocHeadRef">基于 Windows 2000 的计算机</h4>
<p><script type="text/javascript">
            loadTOCNode(3, 'moreinformation');
        </script>对于没有启用本地定义的 IPSec 策略的系统，请按照下列步骤创建一个新的本地静态策略，以阻止定向到未指定现有 IPSec 策略的 Windows 2000 计算机上的特定协议和端口的通信：</p>
<ol>
    <li>验证 IPSec Policy Agent 服务已在&ldquo;服务&rdquo;MMC 管理单元中启用并启动。</li>
    <li>访问下面的 Microsoft 网站以下载并安装 Ipsecpol.exe：
    <div class="indent"><span class="ll"><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=7D40460C-A069-412E-A015-A2AB904B7361">http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=7D40460C-A069-412E-A015-A2AB904B7361</a></span><span class="pLink"> (http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=7D40460C-A069-412E-A015-A2AB904B7361) </span></div>
    </li>
    <li>打开命令提示符窗口，然后将工作文件夹设置为安装 Ipsecpol.exe 的文件夹。<br />
    <br />
    <b>注意</b>：Ipsecpol.exe 的默认文件夹是 C:\Program Files\Resource Kit。</li>
    <li>要创建一个新的本地 IPSec 策略和筛选规则，并将其应用于从任何 IP 地址发送到您要配置的 Windows 2000 计算机的 IP 地址的网络通信，请使用以下命令，其中 <var>Protocol</var> 和 <var>PortNumber</var> 是变量：
    <div class="indent"><span class="userInput">ipsecpol -w REG -p &quot;Block <var>Protocol</var><var>PortNumber</var> Filter&quot; -r &quot;Block Inbound <var>Protocol</var><var>PortNumber</var> Rule&quot; -f *=0:<var>PortNumber</var>:<var>Protocol</var> -n BLOCK &ndash;x</span></div>
    例如，要阻止从任何 IP 地址和任何源端口发往基于 Windows 2000 的计算机上的目标端口 UDP 1434 的网络通信，请键入以下命令。此策略可以有效地保护运行 Microsoft SQL Server 2000 的计算机免遭&ldquo;Slammer&rdquo;蠕虫病毒的攻击。
    <div class="indent"><span class="userInput">ipsecpol -w REG -p &quot;Block UDP 1434 Filter&quot; -r &quot;Block Inbound UDP 1434 Rule&quot; -f *=0:1434:UDP -n BLOCK -x</span></div>
    以下示例可阻止对 TCP 端口 80 的入站访问，但是仍然允许出站 TCP 80 访问。此策略可以有效地保护运行 Microsoft Internet 信息服务 (IIS) 5.0 的计算机免遭&ldquo;Code Red&rdquo;蠕虫病毒和&ldquo;Nimda&rdquo;蠕虫病毒的攻击。
    <div class="indent"><span class="userInput">ipsecpol -w REG -p &quot;Block TCP 80 Filter&quot; -r &quot;Block Inbound TCP 80 Rule&quot; -f *=0:80:TCP -n BLOCK -x</span></div>
    <b>注意</b>：<b>-x</b> 开关会立即指定该策略。如果您输入此命令，将取消指定&ldquo;Block UDP 1434 Filter&rdquo;策略，并指定&ldquo;Block TCP 80 Filter&rdquo;。要添加但不指定该策略，请在键入该命令时不在结尾带 <b>-x</b> 开关。</li>
    <li>要向现有&ldquo;Block UDP 1434 Filter&rdquo;策略中添加其他筛选规则，用于阻止<b>从</b> Windows 2000 计算机发往任何 IP 地址的网络通信，请使用以下命令，其中 <var>Protocol</var> 和 <var>PortNumber</var> 是变量。
    <div class="indent"><span class="userInput">ipsecpol -w REG -p &quot;Block <var>Protocol</var><var>PortNumber</var> Filter&quot; -r &quot;Block Outbound <var>Protocol</var><var>PortNumber</var> Rule&quot; -f *0=:<var>PortNumber</var>:<var>Protocol</var> -n BLOCK</span></div>
    例如，要阻止从基于 Windows 2000 的计算机发往任何其他主机上的 UDP 1434 的任何网络通信，请键入以下命令。此策略可以有效地阻止运行 SQL Server 2000 的计算机传播&ldquo;Slammer&rdquo;蠕虫病毒。
    <div class="indent"><span class="userInput">ipsecpol -w REG -p &quot;Block UDP 1434 Filter&quot; -r &quot;Block Outbound UDP 1434 Rule&quot; -f 0=*:1434:UDP -n BLOCK</span></div>
    <b>注意</b>：您可以使用此命令向策略中添加任意数量的筛选规则（例如，使用此命令通过同一策略阻止多个端口）。</li>
    <li>步骤 5 中的策略现在将生效，并将在每次重新启动计算机后都会生效。但是，如果以后为计算机指定了基于域的 IPSec 策略，此本地策略将被覆盖并将不再适用。要验证您的筛选规则是否已成功指定，请在命令提示符下将工作文件夹设置为 C:\Program Files\Support Tools，然后键入以下命令：
    <div class="indent"><span class="userInput">netdiag /test:ipsec /debug</span></div>
    如果同时指定了用于入站通信和出站通信的策略（如这些示例中所示），您将收到以下消息：
    <div class="message">IP 安全测试。. . . . . . . . : <br />
    传递的本地 IPSec 策略活动:&ldquo;Block UDP 1434 Filter&rdquo;IP 安全策略路径:SOFTWARE\Policies\Microsoft\Windows\IPSec\Policy\Local\ipsecPolicy{D239C599-F945-47A3-A4E3-B37BC12826B9} <br />
    <br />
    有 2 个筛选<br />
    无名称<br />
    筛选 ID:{5EC1FD53-EA98-4C1B-A99F-6D2A0FF94592}<br />
    策略 ID:{509492EA-1214-4F50-BF43-9CAC2B538518}<br />
    源地址:0.0.0.0 源掩码:0.0.0.0 <br />
    目标地址:192.168.1.1 目标掩码:255.255.255.255 <br />
    隧道地址:0.0.0.0 源端口:0 目标端口:1434 <br />
    协议:17 TunnelFilter:无<br />
    标志:入站阻止<br />
    无名称<br />
    筛选 ID:{9B4144A6-774F-4AE5-B23A-51331E67BAB2}<br />
    策略 ID:{2DEB01BD-9830-4067-B58A-AADFC8659BE5}<br />
    源地址:192.168.1.1 源掩码:255.255.255.255 <br />
    目标地址:0.0.0.0 目标掩码:0.0.0.0 <br />
    隧道地址:0.0.0.0 源端口:0 目标端口:1434 <br />
    协议:17 TunnelFilter:无 <br />
    标志:出站阻止</div>
    <b>注意</b>：IP 地址和图形用户界面 (GUID) 号将不同。它们将反映基于 Windows 2000 的计算机的相应内容。</li>
</ol>
<div class="topOfPage">&nbsp;</div>
<h3 id="tocHeadRef">为特定协议和端口添加阻止规则</h3>
<script type="text/javascript">
                loadTOCNode(2, 'moreinformation');
            </script>
<h4 id="tocHeadRef">基于 Windows Server 2003 和 Windows XP 的计算机</h4>
<p><script type="text/javascript">
            loadTOCNode(3, 'moreinformation');
        </script>如果基于 Windows Server 2003 和 Windows XP 的计算机现有一个本地指定的静态 IPSec 策略，那么，要为该计算机上的特定协议和端口添加阻止规则，请按照下列步骤操作：</p>
<ol>
    <li>安装 IPSeccmd.exe。IPSeccmd.exe 是 Windows XP SP2 支持工具的一部分。<br />
    <br />
    有关下载和安装 Windows XP Service Pack 2 支持工具的更多信息，请单击下面的文章编号，以查看 Microsoft 知识库中相应的文章：
    <div class="indent"><a class="KBlink" href="http://support.microsoft.com/kb/838079/">838079</a>&nbsp; <span class="pLink">(http://support.microsoft.com/kb/838079/ ) </span>Windows XP Service Pack 2 支持工具</div>
    </li>
    <li>识别当前指定的 IPSec 策略的名称。为此，请在命令提示符下键入以下命令：
    <div class="indent"><span class="userInput">netdiag /test:ipsec</span></div>
    如果已指定策略，您将收到类似于以下内容的消息：
    <div class="message">IP 安全测试。. . . . . . . . : 传递的<br />
    本地 IPSec 策略活动:&ldquo;Block UDP 1434 Filter&rdquo;</div>
    </li>
    <li>如果已为计算机指定了 IPSec 策略（本地或域），请使用以下命令将其他 BLOCK 筛选规则添加到现有的 IPSec 策略中。<br />
    <br />
    <b>注意</b>：在此命令中，<var>Existing_IPSec_Policy_Name</var>、<var>Protocol</var> 和 <var>PortNumber</var> 是变量。
    <div class="indent"><span class="userInput">IPSeccmd.exe -p &quot;<var>Existing_IPSec_Policy_Name</var>&quot; -w REG -r &quot;Block <var>Protocol</var><var>PortNumber</var> Rule&quot; -f *=0:<var>PortNumber</var>:<var>Protocol</var> -n BLOCK </span></div>
    例如，要向现有&ldquo;Block UDP 1434 Filter&rdquo;中添加一条筛选规则来阻止对 TCP 端口 80 进行的入站访问，请键入以下命令：
    <div class="indent"><span class="userInput">IPSeccmd.exe -p &quot;Block UDP 1434 Filter&quot; -w REG -r &quot;Block Inbound TCP 80 Rule&quot; -f *=0:80:TCP -n BLOCK</span></div>
    </li>
</ol>
<h4 id="tocHeadRef">基于 Windows 2000 的计算机</h4>
<p><script type="text/javascript">
            loadTOCNode(3, 'moreinformation');
        </script>如果基于 Windows 2000 的计算机现有一个本地指定的静态 IPSec 策略，那么，要为该计算机上的特定协议和端口添加阻止规则，请按照下列步骤操作：</p>
<ol>
    <li>访问下面的 Microsoft 网站以下载并安装 Ipsecpol.exe：
    <div class="indent"><a href="http://support.microsoft.com/kb/927229">http://support.microsoft.com/kb/927229</a><span class="pLink"> (http://support.microsoft.com/kb/927229) </span></div>
    </li>
    <li>识别当前指定的 IPSec 策略的名称。为此，请在命令提示符下键入以下命令：
    <div class="indent"><span class="userInput">netdiag /test:ipsec</span></div>
    如果已指定策略，您将收到类似于以下内容的消息：
    <div class="message">IP 安全测试。. . . . . . . . : 传递的<br />
    本地 IPSec 策略活动:&ldquo;Block UDP 1434 Filter&rdquo;</div>
    </li>
    <li>如果已为计算机指定了 IPSec 策略（本地或域），请使用以下命令将其他 BLOCK 筛选规则添加到现有 IPSec 策略中，其中 <var>Existing_IPSec_Policy_Name</var>、<var>Protocol</var> 和 <var>PortNumber</var> 是变量：
    <div class="indent"><span class="userInput">ipsecpol -p &quot;<var>Existing_IPSec_Policy_Name</var>&quot; -w REG -r &quot;Block <var>Protocol</var><var>PortNumber</var> Rule&quot; -f *=0:<var>PortNumber</var>:<var>Protocol</var> -n BLOCK </span></div>
    例如，要向现有&ldquo;Block UDP 1434 Filter&rdquo;中添加一条筛选规则来阻止对 TCP 端口 80 进行的入站访问，请键入以下命令：
    <div class="indent"><span class="userInput">ipsecpol -p &quot;Block UDP 1434 Filter&quot; -w REG -r &quot;Block Inbound TCP 80 Rule&quot; -f *=0:80:TCP -n BLOCK</span></div>
    </li>
</ol>
<div class="topOfPage">&nbsp;</div>
<h3 id="tocHeadRef">为特定协议和端口添加动态阻止策略</h3>
<script type="text/javascript">
                loadTOCNode(2, 'moreinformation');
            </script>
<h4 id="tocHeadRef">基于 Windows Server 2003 和 Windows XP 的计算机</h4>
<p><script type="text/javascript">
            loadTOCNode(3, 'moreinformation');
        </script>有时您可能需要暂时阻止对特定端口的访问。例如，在可以安装修补程序之前，或者在已经为计算机指定基于域的 IPSec 策略时，您就可能需要阻止特定的端口。要使用 IPSec 策略暂时阻止对 Windows Server 2003 或 Windows XP 计算机上的某个端口的访问，请按照下列步骤操作：</p>
<ol>
    <li>安装 IPSeccmd.exe。IPSeccmd.exe 是 Windows XP Service Pack 2 支持工具的一部分。<br />
    <br />
    <b>注意</b>：IPSeccmd.exe 将在 Windows XP 和 Windows Server 2003 操作系统中运行，但仅有 Windows XP SP2 支持工具包中提供此工具。<br />
    <br />
    有关如何下载和安装 Windows XP Service Pack 2 支持工具的更多信息，请单击下面的文章编号，以查看 Microsoft 知识库中相应的文章：
    <div class="indent"><a class="KBlink" href="http://support.microsoft.com/kb/838079/">838079</a>&nbsp; <span class="pLink">(http://support.microsoft.com/kb/838079/ ) </span>Windows XP Service Pack 2 支持工具</div>
    </li>
    <li>要添加一个动态 BLOCK 筛选以阻止从任何 IP 地址发往您系统的 IP 地址和目标端口的所有数据包，请在命令提示符下键入以下命令。<br />
    <br />
    <b>注意</b>：在以下命令中，<var>Protocol</var> 和 <var>PortNumber</var> 是变量。
    <div class="indent"><span class="userInput">IPSeccmd.exe -f [*=0:<var>PortNumber</var>:<var>Protocol</var></span>]</div>
    <b>注意</b>：此命令可动态创建阻止筛选。只要 IPSec Policy Agent 服务在运行，该策略就会保持指定状态。如果重新启动 IPSec Policy Agent 服务或重新启动计算机，此策略将丢失。如果要在每次重新启动系统时动态重新指定 IPSec 筛选规则，请创建一个启动脚本以重新应用该筛选规则。如果您要永久性地应用此筛选，请将该筛选配置为静态 IPSec 策略。&ldquo;IPSec 策略管理&rdquo;MMC 管理单元提供用于管理 IPSec 策略配置的图形用户界面。如果已应用基于域的 IPSec 策略，<span class="userInput">netdiag /test:ipsec /debug</span> 命令仅在由具有域管理员凭据的用户执行时才会显示筛选详细信息。</li>
</ol>
<h4 id="tocHeadRef">基于 Windows 2000 的计算机</h4>
<p><script type="text/javascript">
            loadTOCNode(3, 'moreinformation');
        </script>有时您可能需要暂时阻止特定端口（例如，在可以安装修补程序之前，或者在已经为计算机指定基于域的 IPSec 策略时）。要使用 IPSec 策略暂时阻止对 Windows 2000 计算机上的某个端口的访问，请按照下列步骤操作：</p>
<ol>
    <li>访问下面的 Microsoft 网站以下载并安装 Ipsecpol.exe：
    <div class="indent"><a href="http://support.microsoft.com/kb/927229">http://support.microsoft.com/kb/927229</a><span class="pLink"> (http://support.microsoft.com/kb/927229) </span></div>
    </li>
    <li>要添加一个动态 BLOCK 筛选以阻止从任何 IP 地址发往您系统的 IP 地址和目标端口的所有数据包，请在命令提示符下键入以下命令，其中 <var>Protocol</var> 和 <var>PortNumber</var> 是变量：
    <div class="indent"><span class="userInput">ipsecpol -f [*=0:<var>PortNumber</var>:<var>Protocol</var>]</span></div>
    <b>注意</b>：此命令可动态创建阻止筛选，并且只要 IPSec Policy Agent 服务在运行，该策略就会保持指定状态。如果重新启动 IPSec 服务或重新启动计算机，此设置将丢失。如果要在每次重新启动系统时动态重新指定 IPSec 筛选规则，请创建一个启动脚本以重新应用该筛选规则。如果您要永久性地应用此筛选，请将该筛选配置为静态 IPSec 策略。&ldquo;IPSec 策略管理&rdquo;MMC 管理单元提供用于管理 IPSec 策略配置的图形用户界面。如果已应用基于域的 IPSec 策略，则 <span class="userInput">netdiag /test:ipsec /debug</span> 命令可能仅在由具有域管理员凭据的用户执行时才会显示筛选详细信息。Netdiag.exe 的更新版本将在 Windows 2000 Service Pack 4 中提供，本地管理员可以使用它来查看基于域的 IPSec 策略。</li>
</ol>
<div class="topOfPage">&nbsp;</div>
<h3 id="tocHeadRef">IPSec 筛选规则和组策略</h3>
<p><script type="text/javascript">
                loadTOCNode(2, 'moreinformation');
            </script>在通过组策略设置分配 IPSec 策略的环境中，必须更新整个域的策略才能阻止特定的协议和端口。在成功配置组策略 IPSec 设置后，您必须强制刷新域中所有基于 Windows Server 2003、Windows XP 和 Windows 2000 的计算机上的组策略设置。为此，请使用以下命令：</p>
<div class="indent"><span class="userInput">secedit /refreshpolicy machine_policy</span></div>
<p>IPSec 策略更改将在两个不同轮询间隔之一的间隔内检测到。对于一个新指定的、应用于 GPO 的 IPSec 策略，该 IPSec 策略将在为组策略轮询间隔设置的时间内应用于客户端，或者当在客户端计算机上运行 <span class="userInput">secedit /refreshpolicy machine_policy</span> 命令时应用于客户端。如果已为 GPO 指定了 IPSec 策略并且正在将新的 IPSec 筛选或规则添加到现有策略中，<span class="userInput">secedit</span> 命令将不会使 IPSec 识别发生更改。在这种情况下，系统将在基于 GPO 的现有 IPSec 策略自己的轮询间隔内检测到对该 IPSec 策略的修改。此时间间隔是在该 IPSec 策略的&ldquo;常规&rdquo;选项卡上指定的。您还可以通过重新启动 IPSec Policy Agent 服务来强制刷新 IPSec 策略设置。如果 IPSec 服务停止或重新启动，由 IPSec 保护的通讯将中断并将需要几秒钟的时间才能恢复。这可能导致程序连接被断开，对于主动传输大量数据的连接更是如此。当 IPSec 策略只应用于本地计算机时，您不必重新启动该服务。</p>
<div class="topOfPage">&nbsp;</div>
<h3 id="tocHeadRef">取消指定和删除 IPSec 策略</h3>
<script type="text/javascript">
                loadTOCNode(2, 'moreinformation');
            </script>
<h4 id="tocHeadRef">基于 Windows Server 2003 和 Windows XP 的计算机</h4>
<script type="text/javascript">
            loadTOCNode(3, 'moreinformation');
        </script>
<ul>
    <li><b>具有本地定义的静态策略的计算机</b>
    <ol>
        <li>打开命令提示符窗口，然后将工作文件夹设置为安装 Ipsecpol.exe 的文件夹。</li>
        <li>要取消指定您以前创建的筛选，请使用以下命令：
        <div class="indent"><span class="userInput">IPSeccmd.exe -w REG -p &quot;Block <var>Protocol</var><var>PortNumber</var> Filter&quot; &ndash;y </span></div>
        例如，要取消指定以前创建的&ldquo;Block UDP 1434 Filter&rdquo;，请使用以下命令：
        <div class="indent"><span class="userInput">IPSeccmd.exe -w REG -p &quot;Block UDP 1434 Filter&quot; -y</span></div>
        </li>
        <li>要删除您创建的筛选，请使用以下命令：
        <div class="indent"><span class="userInput">IPSeccmd.exe -w REG -p &quot;Block <var>Protocol</var><var>PortNumber</var> Filter&quot; -r &quot;Block <var>Protocol</var><var>PortNumber</var> Rule&quot; &ndash;o</span></div>
        例如，要删除&ldquo;Block UDP 1434 Filter&rdquo;筛选和以前创建的两个规则，请使用以下命令：
        <div class="indent"><span class="userInput">IPSeccmd.exe -w REG -p &quot;Block UDP 1434 Filter&quot; -r &quot;Block Inbound UDP 1434 Rule&quot; -r &quot;Block Outbound UDP 1434 Rule&quot; -o</span></div>
        </li>
    </ol>
    </li>
    <li><b>具有本地定义的动态策略的计算机</b><br />
    如果通过使用 <span class="userInput">net stop policyagent</span> 命令停止 IPSec Policy Agent 服务，将取消应用动态 IPSec 策略。要删除以前使用的特定命令而不停止 IPSec Policy Agent 服务，请按照下列步骤操作：
    <ol>
        <li>打开命令提示符窗口，然后将工作文件夹设置为安装 Windows XP Service Pack 2 支持工具的文件夹。</li>
        <li>键入下面的命令：
        <div class="indent"><span class="userInput">IPSeccmd.exe &ndash;u</span></div>
        <b>注意</b>：您还可以重新启动 IPSec Policy Agent 服务以清除所有动态指定的策略。</li>
    </ol>
    </li>
</ul>
<h4 id="tocHeadRef">基于 Windows 2000 的计算机</h4>
<script type="text/javascript">
            loadTOCNode(3, 'moreinformation');
        </script>
<ul>
    <li><b>具有本地定义的静态策略的计算机</b>
    <ol>
        <li>打开命令提示符窗口，然后将工作文件夹设置为安装 Ipsecpol.exe 的文件夹。</li>
        <li>要取消指定您以前创建的筛选，请使用以下命令：
        <div class="indent"><span class="userInput">ipsecpol -w REG -p &quot;Block <var>Protocol</var><var>PortNumber</var> Filter&quot; &ndash;y </span></div>
        例如，要取消指定以前创建的&ldquo;Block UDP 1434 Filter&rdquo;，请使用以下命令：
        <div class="indent"><span class="userInput">ipsecpol -w REG -p &quot;Block UDP 1434 Filter&quot; -y</span></div>
        </li>
        <li>要删除您创建的筛选，请使用以下命令：
        <div class="indent"><span class="userInput">ipsecpol -w REG -p &quot;Block <var>Protocol</var><var>PortNumber</var> Filter&quot; -r &quot;Block <var>Protocol</var><var>PortNumber</var> Rule&quot; &ndash;o</span></div>
        例如，要删除&ldquo;Block UDP 1434 Filter&rdquo;筛选和以前创建的两个规则，请使用以下命令：
        <div class="indent"><span class="userInput">ipsecpol -w REG -p &quot;Block UDP 1434 Filter&quot; -r &quot;Block Inbound UDP 1434 Rule&quot; -r &quot;Block Outbound UDP 1434 Rule&quot; -o</span></div>
        </li>
    </ol>
    </li>
    <li><b>具有本地定义的动态策略的计算机</b><br />
    <br />
    如果通过使用 <span class="userInput">net stop policyagent</span> 命令停止 IPSec Policy Agent 服务，将取消应用动态 IPSec 策略。但是，要删除以前使用的特定命令而不停止 IPSec Policy Agent 服务，请按照下列步骤操作：
    <ol>
        <li>打开命令提示符窗口，然后将工作文件夹设置为安装 Ipsecpol.exe 的文件夹。</li>
        <li>键入下面的命令：
        <div class="indent"><span class="userInput">Ipsecpol &ndash;u</span></div>
        <b>注意</b>：您还可以重新启动 IPSec Policy Agent 服务以清除所有动态指定的策略。</li>
    </ol>
    </li>
</ul>
<div class="topOfPage">&nbsp;</div>
<h3 id="tocHeadRef">将您的新筛选规则应用到所有协议和端口</h3>
<p><script type="text/javascript">
                loadTOCNode(2, 'moreinformation');
            </script>默认情况下，在 Microsoft Windows 2000 和 Microsoft Windows XP 中，IPSec 使得广播、多路广播、RSVP、IKE 和 Kerberos 通信免于受到任何筛选和身份验证的限制。有关这些例外的其他信息，请单击下面的文章编号，以查看 Microsoft 知识库中相应的文章：</p>
<div class="indent"><a class="KBlink" href="http://support.microsoft.com/kb/253169/">253169</a>&nbsp; <span class="pLink">(http://support.microsoft.com/kb/253169/ ) </span>IPSec 可以保护的和无法保护的通信</div>
<p>当 IPSec 只用于允许和阻止通信时，可以通过更改注册表值来删除对 Kerberos 和 RSVP 协议的豁免。有关如何执行此操作的完整说明，请单击下面的文章编号，以查看 Microsoft 知识库中相应的文章：</p>
<div class="indent"><a class="KBlink" href="http://support.microsoft.com/kb/254728/">254728</a>&nbsp; <span class="pLink">(http://support.microsoft.com/kb/254728/ ) </span>IPSec 不保护域控制器之间的 Kerberos 通信</div>
<p>通过按照这些说明进行操作，即使攻击者将他们的源端口设置为 Kerberos 端口 TCP/UDP 88，您也可以保护 UDP 1434。通过删除 Kerberos 豁免，现在可以将 Kerberos 数据包与 IPSec 策略中的所有筛选进行匹配。因此，可以在 IPSec 内部对 Kerberos 进行保护（阻止或允许）。这样，如果 IPSec 筛选与发往域控制器 IP 地址的 Kerberos 通信匹配，您可能必须更改 IPSec 策略设计来添加新的筛选，以便允许发往各个域控制器 IP 地址的 Kerberos 通信（如果您没有按照知识库文章 254728 的说明使用 IPSec 来保护域控制器之间的所有通信）。</p>
<div class="topOfPage">&nbsp;</div>
<h3 id="tocHeadRef">在计算机重新启动时应用 IPSec 筛选规则</h3>
<p><script type="text/javascript">
                loadTOCNode(2, 'moreinformation');
            </script>所有 IPSec 策略均依赖于要指定的 IPSec Policy Agent 服务。当基于 Windows 2000 的计算机正在启动过程中时，IPSec Policy Agent 服务未必是第一个启动的服务。这样，计算机的网络连接可能会在某个很短的时间内容易受到病毒或蠕虫病毒的攻击。这种情况仅在满足以下条件时才会发生：IPSec Policy Agent 服务尚未完全启动并指定所有策略，存在潜在漏洞的服务便已成功启动并开始接受连接。</p>
<p>&nbsp;</p>
<p>原文：<a href="http://support.microsoft.com/kb/813878/zh-cn">http://support.microsoft.com/kb/813878/zh-cn</a></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.anywolfs.com/liuhui/article.asp?id=417" /> 
	  <id>http://www.anywolfs.com/liuhui/default.asp?id=417</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[iobw.tst]]></title>
	  <author>
		 <name>jothui</name>
		 <uri>http://www.anywolfs.com/liuhui/</uri>
		 <email>jothui8@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://www.anywolfs.com/liuhui/default.asp?cateID=6" label="Software" /> 
	  <updated>2009-04-16T12:44:49+08:00</updated>
	  <published>2009-04-16T12:44:49+08:00</published>
		  <summary type="html"><![CDATA[在C:\盘根目录下发现一个巨大的文件iobw.tst，体积有6G多，创建者是administrator，占用了大量的宝贵资源，引起我的注意，在百度上居然没有找到相关的说明，在google上终于找到头绪，有网友留言说是否使用过“IOmeter“软件，我想起来了，我确实用过，用来测试硬盘信息，现在这个软件我已经删除了，不再使用。<br/>恩 ，有门，删了它，浪费空间可耻。<br/>于是我就删除了这个占用6G空间的没有用的恐怖文件。]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.anywolfs.com/liuhui/article.asp?id=416" /> 
	  <id>http://www.anywolfs.com/liuhui/default.asp?id=416</id>
  </entry>	
		
</feed>
