<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[gOxiA=苏繁=SuFan Blog]]></title> 
<link>https://maytide.net/index.php</link> 
<description><![CDATA[gOxiA,苏繁,sufan,Microsoft MVP]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[gOxiA=苏繁=SuFan Blog]]></copyright>
<item>
<link>https://maytide.net/read.php/2163.htm</link>
<title><![CDATA[项目发布: CMD to PowerShell 转换器]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Thu, 09 Oct 2025 07:59:29 +0000</pubDate> 
<guid>https://maytide.net/read.php/2163.htm</guid> 
<description>
<![CDATA[ 
	<p><a href="http://goxia.maytide.net/ftpup/2018/2ba640123a0f_DB2A/cmd2ps-logo.png"><img width="380" height="60" title="cmd2ps-logo" style="border: 0px currentcolor; border-image: none; display: inline; background-image: none;" alt="cmd2ps-logo" src="http://goxia.maytide.net/ftpup/2018/2ba640123a0f_DB2A/cmd2ps-logo_thumb.png" border="0"></a></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PowerShell 已经发布很多年，可以追溯到 2006年，首次面向 Windows XP/Server 2003 发布，距今已经近 20年，现在已经发展成为一种跨平台的任务自动化解决方案，除了面向 Windows 以外，还提供了很多微软模块的支持，例如：Azure，Exchange，SQL 等等！我们几乎可以在任何微软产品或服务中看到它的身影，甚至一些第三方产品，如 AWS、VMware、Google Cloud！它已经成为 IT 专业人员必须掌握的一门脚本语言，我们还可以在 Linux 或 MacOS 安装和使用它。当前最新的正式版本是 PowerShell 7.5，基于 dotNET 9；此外 PowerShell 7.6 Preview 也已经发布，如果感兴趣可转向 "<a href="https://learn.microsoft.com/en-us/powershell/scripting/overview?view=powershell-7.5/?WT.mc_id=WDIT-MVP-4000544" target="_blank">What is PowerShell</a>" 获取更多有关 PowerShell 的资讯。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 而今天 <a href="https://goxia.maytide.net" target="_blank">gOxiA</a> 要与大家分享的是近期手搓的一个项目 <a href="https://cmd2ps.mdt.ink/" target="_blank">CMD-PowerShell-Converter</a>，主要便于自己快速查询一些 CMD 到 PowerShell 的基本命令行的使用，它是一个现代化的 Web 应用程序，用于在 CMD 和 PowerShell 命令之间进行转换，主要提供以下功能和特性：</p><h5><font size="2"> 双向转换</font></h5><ul><li><font size="2">CMD → PowerShell: 将传统CMD命令转换为现代PowerShell等价命令</font><li><font size="2">PowerShell → CMD: 将PowerShell命令转换为CMD命令</font><li><font size="2">智能检测: 自动识别输入的命令类型</font></li></ul><h5><font size="2"> 智能建议</font></h5><ul><li><font size="2">提供相关命令建议和示例</font><li><font size="2">显示参数说明和用法</font><li><font size="2">常用命令快速访问</font></li></ul><h5><font size="2"> 现代化界面</font></h5><ul><li><font size="2">响应式设计: 支持桌面、平板和手机</font><li><font size="2">主题切换: 明亮、深色、自动模式</font><li><font size="2">直观布局: 左右分屏，类似翻译界面</font><li><font size="2">快捷操作: 一键交换、复制、清空</font></li></ul><h5><font size="2"> PWA功能</font></h5><ul><li><font size="2">离线使用: 完全支持离线操作</font><li><font size="2">应用安装: 可安装到设备，如原生应用</font><li><font size="2">快速启动: 优化的缓存策略</font><li><font size="2">跨平台: 支持Windows、macOS、Linux、Android、iOS</font></li></ul><h5><font size="2"> 数据管理</font></h5><ul><li><font size="2">历史记录: 自动保存转换历史</font><li><font size="2">本地存储: 使用IndexedDB安全存储</font><li><font size="2">数据导出: 支持备份和恢复</font><li><font size="2">自定义规则: 可添加个人转换规则</font></li></ul><p><a href="http://goxia.maytide.net/ftpup/2018/2ba640123a0f_DB2A/cmd2ps-mainscreen.png"><img width="630" height="659" title="cmd2ps-mainscreen" style="border: 0px currentcolor; border-image: none; display: inline; background-image: none;" alt="cmd2ps-mainscreen" src="http://goxia.maytide.net/ftpup/2018/2ba640123a0f_DB2A/cmd2ps-mainscreen_thumb.png" border="0"></a></p><p>该 Web 程序已发布在 Github 上，项目地址：<a title="https://github.com/goxia/Codes/tree/main/CMD-PowerShell-Converter" href="https://github.com/goxia/Codes/tree/main/CMD-PowerShell-Converter">https://github.com/goxia/Codes/tree/main/CMD-PowerShell-Converter</a>，感兴趣的朋友可以自行完善</p><p>推荐官方文档：</p><p><a href="https://learn.microsoft.com/en-us/powershell/scripting/learn/ps101/01-getting-started?view=powershell-7.5/?WT.mc_id=WDIT-MVP-4000544" target="_blank">Getting started with PowerShell &#124; Microsoft Learn</a></p>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/1714.htm</link>
<title><![CDATA[[PS]使用 PowerShell 下载文件]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Mon, 24 Feb 2014 05:05:47 +0000</pubDate> 
<guid>https://maytide.net/read.php/1714.htm</guid> 
<description>
<![CDATA[ 
	<p><a href="http://goxia.maytide.net/ftpupfiles/PS-PowerShell-_1055C/powershell_logo.png"><img title="powershell_logo" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="powershell_logo" src="http://goxia.maytide.net/ftpupfiles/PS-PowerShell-_1055C/powershell_logo_thumb.png" width="345" height="70"></a></p> <p><font color="#fd3f0d" size="4"><strong>使用 PowerShell 下载文件</strong></font></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;前段时间部署了一个基于 Windows Server 2012 R2 的 Server Core 环境，在实际使用中会遇到需要从网站上下载文件的问题，因为 Server Core 并未提供 IE，所以下载就不是那么方便了。还好在 PowerShell 下可以调用 System.Net.WebClient 来实现下载。即：</p> <p><div class="code">$client = New-Object “System.Net.WebClient”</div></p> <p><div class="code">$client.DownloadFile(“http://www.maytide.net/info.txt”,”D:&#92;info.txt”)</div></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;虽然上述的脚本实现了从一个 URL 下载文件到本地，但是实际调用起来会感觉很麻烦。因为每次都要输入很长的脚本命令才能完成一个下载。<a href="http://goxia.maytide.net/" target="_blank">gOxiA</a> 在编程方面也没什么天赋，实属一菜鸟，参考了以前的脚本写了一个粗糙的下载脚本，其功能是执行脚本后提示输入 URL 的地址，然后再输入本地存储的文件路径，最后执行下载，并根据结果判断是否下载完毕。</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;脚本中涉及了一些基本的命令代码，其中 Write-Host 用于输出提示文本；Read-Host 用于记录用户输入的数据；调用下载、下载地址、本地存储都使用变量，最后用 Test-Path 对下载的文件进行检查，并使用 if...else 进行判断。下面就是整个脚本的内容：</p> <p><em><font color="#00ff00">#清屏<br/></font></em>Clear<br/><em><font color="#00ff00">#脚本基本信息提示</font></em><br/>Write-Host<br/>Write-Host PowerShell Download Tools Script.<br/>Write-Host<br/><em><font color="#00ff00">#输入下载资源地址，赋予变量 $url</font></em><br/>Write-Host Please enter URL address of download sources! -ForegroundColor Red<br/>$url= Read-Host "Enter the URL..."<br/>Write-Host<br/><em><font color="#00ff00">#输入文件存储路径，赋予变量 $local<br/></font></em>Write-Host Please enter the local store path! -ForegroundColor Green<br/>$local= Read-Host "Enter the store path..."<br/><em><font color="#00ff00">#调用下载，赋予变量 $dl<br/></font></em>$dl= New-Object "System.Net.WebClient"<br/><em><font color="#00ff00">#执行下载</font></em><br/>Write-Host<br/>Write-Host Downloading... Please wait!!!<br/>$dl.DownloadFile("$url","$local")<br/>Write-Host<br/><em><font color="#00ff00">#将路径检查命令赋予变量 $result</font></em><br/>$result=Test-Path $local<br/><em><font color="#00ff00">#对 $result 结果进行判断，如果是 True 表示下载完成，否则失败</font></em><br/>if($result -eq $True)<br/>&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;Write-Host Result status: Completed!!! -ForegroundColor Green<br/>&#125;<br/>else<br/>&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;Write-Host Result status: Failed!!! -ForegroundColor Red<br/>&#125;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;执行效果如下图：</p> <p><a href="http://goxia.maytide.net/ftpupfiles/PS-PowerShell-_1055C/image.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://goxia.maytide.net/ftpupfiles/PS-PowerShell-_1055C/image_thumb.png" width="634" height="376"></a></p><br/>Tags - <a href="https://maytide.net/go.php/tags/microsoft/" rel="tag">microsoft</a> , <a href="https://maytide.net/go.php/tags/windows/" rel="tag">windows</a> , <a href="https://maytide.net/go.php/tags/server/" rel="tag">server</a> , <a href="https://maytide.net/go.php/tags/2012/" rel="tag">2012</a> , <a href="https://maytide.net/go.php/tags/r2/" rel="tag">r2</a> , <a href="https://maytide.net/go.php/tags/servercore/" rel="tag">servercore</a> , <a href="https://maytide.net/go.php/tags/powershell/" rel="tag">powershell</a> , <a href="https://maytide.net/go.php/tags/download/" rel="tag">download</a>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/1386.htm</link>
<title><![CDATA[[Scripts]分享一段有趣的 VBScript 让计算机讲出你想说的]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Thu, 03 Jun 2010 09:25:31 +0000</pubDate> 
<guid>https://maytide.net/read.php/1386.htm</guid> 
<description>
<![CDATA[ 
	<p><a href="http://goxia.maytide.net/ftpupfiles/ScriptsVBScript_F531/ScriptingGuy.jpg"><img style="display: inline; border: 0px" src="http://goxia.maytide.net/ftpupfiles/ScriptsVBScript_F531/ScriptingGuy_thumb.jpg" border="0" alt="ScriptingGuy" title="ScriptingGuy" width="64" height="64" /></a> 使用 VBScript 让计算机讲出你想说的话</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://goxia.maytide.net/" target="_blank">gOxiA</a> 对 Scripts 和其他开发语言都并不熟悉，这段脚本程序也是从新浪微博上转过来的，转载率非常之高，到底是因为什么引人关注呢？！将下面这段脚本命令输入到记事本中，并存储为 vbs 扩展名，打开音箱或带上耳机，最后双击运行。</p><p><div class="code">CreateObject(&quot;SAPI.SpVoice&quot;).Speak &quot;I Love You&quot;</div></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Yeh，你将会听到一段计算机语音朗读出&ldquo;I Love You&rdquo;，是不是很有意思。简单的一段命令便能够让计算机讲出你想说的话，看来还是很有使用价值的。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这段脚本其实是使用了 Windows API 来调用了&ldquo;Windows 讲述人&rdquo;功能，Microsoft 为我们提供了强大的接口能够让我们利用 Windows 的功能实现更多的应用！而且利用脚本我们能高效的完成很多工作！</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Microsoft Scripts Center 提供了非常有价值的脚本学习资料，如果你有兴趣不妨学习学习！也许你也能利用 Windows 搞出来有意思的应用或提高你的工作效率。</p><br/>Tags - <a href="https://maytide.net/go.php/tags/scripts/" rel="tag">scripts</a> , <a href="https://maytide.net/go.php/tags/vbs/" rel="tag">vbs</a>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/1323.htm</link>
<title><![CDATA[[PowerShell] 正确使用 Windows PowerShell 执行服务器管理器操作]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 14 Nov 2009 09:07:51 +0000</pubDate> 
<guid>https://maytide.net/read.php/1323.htm</guid> 
<description>
<![CDATA[ 
	<p><a href="http://goxia.maytide.net/ftpupfiles/PowerShellWindowsPowerShell_F0CF/powershell_logo.jpg" target="_blank"><img style="display: inline; border: 0px" src="http://goxia.maytide.net/ftpupfiles/PowerShellWindowsPowerShell_F0CF/powershell_logo_thumb.jpg" border="0" alt="powershell_logo" title="powershell_logo" width="200" height="200" /></a> 正确使用 Windows PowerShell 执行服务器管理器操作</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 最近在学习 Exchange 2010，其中会涉及到 Exchange 2010 的安装前准备工作，而这一内容主要包括了系统角色及功能的安装，虽然通过图形界面可以执行这些操作，但是如果使用命令行来执行自动化的批量安装岂不是更好。借此机会 <a href="http://goxia.maytide.net/" target="_blank">gOxiA</a> 可以好好学习学习 Windows Server 2008 R2 的管理命令。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 大家应该知道，在 Windows Server 2008 R2 上，Windows PowerShell 的角色更加重要了，当我们再使用 ServerManagerCmd 来执行角色和功能安装时会看到一段系统提示，告知我们这一服务器管理命令将在下一个系统版本中被抛弃，取而代之的是 Windows PowerShell cmdlet，不可否认从目前相关的介绍来看 Windows PowerShell 是非常强大的，并且已经有很多微软产品开始支持基于 Windows PowerShell 的管理。看来大势已定，不想落后就必须学习和了解 Windows PowerShell！</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 其实，gOxiA 对 Windows PowerShell 了解甚少，看到那些涉及到编程语言的字符我就害怕（编程菜鸟，完全不懂的级别），这不今天就出了丑！从相关帮助中了解到，在 Windows PowerShell 下可以使用 <span style="background-color: #ffff00">Get-WindowsFeature</span>、<span style="background-color: #ffff00">Add-WindowsFeature</span> 和 <span style="background-color: #ffff00">Remove-WindowsFeature</span> 来管理服务器的角色和功能，出于之前对 Windows PowerShell 的简单认识，于是找到了附件中的 Windows PowerShell 程序并启动了它。</p><p><a href="http://goxia.maytide.net/ftpupfiles/PowerShellWindowsPowerShell_F0CF/WindowsPowerShell.png" target="_blank"><img style="display: inline; border: 0px" src="http://goxia.maytide.net/ftpupfiles/PowerShellWindowsPowerShell_F0CF/WindowsPowerShell_thumb.png" border="0" alt="WindowsPowerShell" title="WindowsPowerShell" width="411" height="460" /></a> </p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在打开的 Windows PowerShell 环境下，键入了 Get-WindowsFeature，问题出来了！给我反馈了一大堆的红色错误信息，很明显 Windows PowerShell 并未识别这个命令。如下图所示：</p><p><a href="http://goxia.maytide.net/ftpupfiles/PowerShellWindowsPowerShell_F0CF/ps_module_error.png" target="_blank"><img style="display: inline; border: 0px" src="http://goxia.maytide.net/ftpupfiles/PowerShellWindowsPowerShell_F0CF/ps_module_error_thumb.png" border="0" alt="ps_module_error" title="ps_module_error" width="644" height="122" /></a>&nbsp;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 查阅了 TechNet 资源库才了解到，如果通过 Windows PowerShell 来执行服务器管理器的操作，必须加载其对应的模块 &mdash; ServerManager，我们可以在 Windows PowerShell 环境下执行&ldquo;<span style="background-color: #ffff00">Get-Module</span>&rdquo;获取当前系统中的模块。gOxiA 的个人理解是 Windows PowerShell 是一个功能强大的环境，除了内置的命令和支持以外，我们还可以通过其他产品本身提供的 Windows PowerShell 模块，为其提供在 Windows PowerShell 环境下对该产品的管理支持。比如 Exchange Server，就在其程序组中提供了一个 PoweShell 的快捷方式，通过该程序打开的 PowerShell 环境将可以直接支持 Exchange Server。</p><p><a href="http://goxia.maytide.net/ftpupfiles/PowerShellWindowsPowerShell_F0CF/getmodule.png" target="_blank"><img style="display: inline; border: 0px" src="http://goxia.maytide.net/ftpupfiles/PowerShellWindowsPowerShell_F0CF/getmodule_thumb.png" border="0" alt="get-module" title="get-module" width="644" height="157" /></a> </p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 既然如此，那么在 Windows Server 2008 R2 中应该同样也提供了一个与之类似的快捷方式，原来在&ldquo;管理工具&rdquo;程序组中确实提供了一个 PowerShell 快捷方式，名为：&ldquo;Windows PowerShell Modules&rdquo;。直接启动这个程序，便可以在 Windows PowerShell 环境下执行服务器管理器操作。</p><p><a href="http://goxia.maytide.net/ftpupfiles/PowerShellWindowsPowerShell_F0CF/WindowsPowerShellModules.png" target="_blank"><img style="display: inline; border: 0px" src="http://goxia.maytide.net/ftpupfiles/PowerShellWindowsPowerShell_F0CF/WindowsPowerShellModules_thumb.png" border="0" alt="WindowsPowerShellModules" title="WindowsPowerShellModules" width="333" height="484" /></a> </p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 前面已经讲过，只要 Windows PowerShell 加载对应的模块，即可以通过 Windows PowerShell 执行相关的操作。那么我们在默认 Windows PowerShell 环境下只需要执行&ldquo;<span style="background-color: #ffff00">Import-Module ModuleName</span>&rdquo;即可加载相关的模块。如下图所示：</p><p><a href="http://goxia.maytide.net/ftpupfiles/PowerShellWindowsPowerShell_F0CF/importmodule_servermanager.png" target="_blank"><img style="display: inline; border: 0px" src="http://goxia.maytide.net/ftpupfiles/PowerShellWindowsPowerShell_F0CF/importmodule_servermanager_thumb.png" border="0" alt="import-module_servermanager" title="import-module_servermanager" width="644" height="483" /></a></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 最后，需要注意的是当重新进入 Windows PowerShell 后需要重新加载需要使用的模块。关于 PowerShell 的使用 gOxiA 也在逐步进行学习和了解，希望日后能有更大的收获！ </p><br/>Tags - <a href="https://maytide.net/go.php/tags/microsoft/" rel="tag">microsoft</a> , <a href="https://maytide.net/go.php/tags/windows/" rel="tag">windows</a> , <a href="https://maytide.net/go.php/tags/powershell/" rel="tag">powershell</a> , <a href="https://maytide.net/go.php/tags/servermanager/" rel="tag">servermanager</a>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/169.htm</link>
<title><![CDATA[HTA Application 的基本特性]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jun 2007 02:12:44 +0000</pubDate> 
<guid>https://maytide.net/read.php/169.htm</guid> 
<description>
<![CDATA[ 
	<p>      节选自MVP友人碎片的一篇Blog：<a href="http://www.kernelmode.com.cn/article.asp?id=5">终极改变：内嵌脚本到一个GUI界面</a>。为了使脚本变得更加人性化、更具交互式那么HTA是最佳的选择，脚本的学习和应用对ITPro来说是至关重要的，其好处我就不过多阐述。</p><p>      节选碎片的这片文章中“HTA Application 的基本特性”部分主要是计划自己写个imagex的操作脚本并集成到我自己个性化过的VistaPE中，这样方便我周围的一些朋友是用VistaPE来备份或恢复系统是用。</p><p>      其实本人对脚本的编程实属菜鸟，工作中涉及到的一些脚本也都是从微软脚本中心找到修改的，个人检讨应该开始重点学习脚本的编程了……</p><p>      HTA Application 的基本特性：<br/>............<br/>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/175.htm</link>
<title><![CDATA[将用户添加到本地Windows管理员组]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Mon, 04 Jun 2007 04:02:26 +0000</pubDate> 
<guid>https://maytide.net/read.php/175.htm</guid> 
<description>
<![CDATA[ 
	<p><b>支持平台</b></p><table class="dataTable" id="EMB" cellspacing="0" cellpadding="0"><thead><tr class="stdHeader" valign="top"><td id="colEOB" width="35%">Windows XP</td><td id="colESB" style="BORDER-RIGHT: #cccccc 1px solid" width="65%">是</td></tr></thead><tbody><tr class="record" valign="top"><td><p class="lastInCell">Windows Server 2003</p></td><td style="BORDER-RIGHT: #cccccc 1px solid"><p class="lastInCell"><b>是</b></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell">Windows 2000</p></td><td style="BORDER-RIGHT: #cccccc 1px solid"><p class="lastInCell"><b>是</b></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell">Windows NT 4.0</p></td><td style="BORDER-RIGHT: #cccccc 1px solid"><p class="lastInCell"><b>是，需要安装</b><a href="http://www.microsoft.com/windows2000/server/evaluation/news/bulletins/adextension.asp">Active Directory Client Extensions</a><b /></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell">Windows 98</p></td><td style="BORDER-RIGHT: #cccccc 1px solid"><p class="lastInCell"><b>是，需要安装</b><a href="http://www.microsoft.com/windows2000/server/evaluation/news/bulletins/adextension.asp">Active Directory Client Extensions</a><b /></p></td></tr></tbody></table><div class="dataTableBottomMargin"></div><p><b>脚本代码</b></p><pre class="codeSample"><div class="code">strComputer = &quot;MyComputer&quot;<br/>Set objGroup = GetObject(&quot;WinNT://&quot; &amp; strComputer &amp; &quot;/Administrators,group&quot;)<br/>Set objUser = GetObject(&quot;WinNT://&quot; &amp; strComputer &amp; &quot;/kenmyer,user&quot;)<br/>objGroup.Add(objUser.ADsPath)</div><br/></pre>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/368.htm</link>
<title><![CDATA[使用脚本实现登录时的Num Lock 状态]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Thu, 24 Aug 2006 00:55:43 +0000</pubDate> 
<guid>https://maytide.net/read.php/368.htm</guid> 
<description>
<![CDATA[ 
	<p>      通常我们为了实现数字键盘打开都会编辑注册表，对于初手要记住老长的键位确实够难的，所以我们可以通过脚本来实现此要求，编写的脚本放到启动项或同过组策略自动运行即可。不过我怎么感觉这样很麻烦，呵呵！总之微软既然为大家提供了此HOWTO我想还是应该学习利用一下的。脚本内容如下：</p><p><div class="code">set WshShell = CreateObject(&quot;WScript.Shell&quot;)<br />WshShell.SendKeys &quot;&#123;NUMLOCK&#125;&quot;</div></p><p>保存为numlock.vbs即可！</p><p>原文地址：<a href="http://support.microsoft.com/kb/314879/zh-cn">http://support.microsoft.com/kb/314879/zh-cn</a></p>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/837.htm</link>
<title><![CDATA[通过脚本察看当前TCP的连接数目]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Thu, 27 Jul 2006 08:57:51 +0000</pubDate> 
<guid>https://maytide.net/read.php/837.htm</guid> 
<description>
<![CDATA[ 
	<p>在网上找了个脚本可以查询到当前TCP的连接数目，非常有用哦！</p><p><div class="code">strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:\\&quot; &amp; strComputer &amp; &quot;\root\cimv2&quot;)<br />Set objNetworkSettings = objWMIService.Get(&quot;Win32_NetworkAdapterConfiguration&quot;)<br />Wscript.Echo &quot;TCP连接数: &quot; &amp; objNetworkSettings.SetTCPNumConnections</div></p>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/838.htm</link>
<title><![CDATA[通过VBS脚本提取IUSR和IWAM帐户的密码]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Thu, 29 Jun 2006 09:25:37 +0000</pubDate> 
<guid>https://maytide.net/read.php/838.htm</guid> 
<description>
<![CDATA[ 
	<p><div class="code"><font size=\"2\"><font face=\"Courier New\">Dim IIsObject<br />Set IIsObject = GetObject (&quot;IIS://localhost/w3svc&quot;)<br />WScript.Echo &quot;AnonymousUserName = &quot; &amp; IIsObject.Get(&quot;AnonymousUserName&quot;) &amp; vbCrlf &amp; _ <br />&quot;AnonymousUserPass = &quot; &amp; IIsObject.Get(&quot;AnonymousUserPass&quot;) &amp;vbCrlf &amp;vbCrlf &amp;_ <br />&quot;WAMUserName = &quot; &amp; IIsObject.Get(&quot;WAMUserName&quot;) &amp; vbCrlf &amp; _<br />&quot;WAMUserPass = &quot; &amp; IIsObject.Get(&quot;WAMUserPass&quot;) <br /></font><font face=\"courier\">Set IIsObject = Nothing</div></font></font></p>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/839.htm</link>
<title><![CDATA[更改 DNS 区域类型]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Thu, 30 Mar 2006 10:53:05 +0000</pubDate> 
<guid>https://maytide.net/read.php/839.htm</guid> 
<description>
<![CDATA[ 
	<p>本文摘自：<a href="http://www.microsoft.com/china/technet/community/scriptcenter/network/scrnet139.mspx">http://www.microsoft.com/china/technet/community/scriptcenter/network/scrnet139.mspx</a><br/>............<br/>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/877.htm</link>
<title><![CDATA[创建名称服务器 DNS 记录]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Thu, 30 Mar 2006 10:51:20 +0000</pubDate> 
<guid>https://maytide.net/read.php/877.htm</guid> 
<description>
<![CDATA[ 
	<table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td valign="top"><span><p>本文摘自：<a href="http://www.microsoft.com/china/technet/community/scriptcenter/network/scrnet153.mspx"></a><a href="http://www.microsoft.com/china/technet/community/scriptcenter/network/scrnet153.mspx" target="_blank">http://www.microsoft.com/china/technet/community/scriptcenter/network/scrnet153.mspx</a></p><p><strong><br />描述</strong></p><p>在 DNS 服务器上创建名称服务器 (NS) 记录。</p><p>有关在这段代码中使用的 CreateInstanceFromPropertyData 方法的更多信息，请单击<a href="http://msdn.microsoft.com/library/en-us/dns/dns/microsoftdns_nstype_createinstancefrompropertydata.asp">此处</a>。</p><p><strong><br />支持平台</strong></p><table border="0" cellspacing="0" cellpadding="0" class="dataTable" id="ENB"><thead></thead><tbody><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows Server 2003</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows XP</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>否（然而，可以在 Windows XP 计算机上对远程 DNS 服务器运行脚本）</strong></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows 2000</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是，需要安装 DNS WMI 提供程序</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows NT 4.0</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>否</strong></p></td></tr></tbody></table><p><br /><strong>脚本代码<br /></strong>strDNSServer = &quot;atl-dc-03.fabrikam.com&quot;<br />strContainer = &quot;fabrikam.com&quot;<br />strOwner = &quot;atl-srv-01.fabrikam.com&quot;<br />intRecordClass = 1<br />intTTL = 600<br />strNSHost = &quot;nameserver.fabrikam.com&quot;<br />strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&#92;&#92;&quot; &amp; strComputer &amp; &quot;&#92;root&#92;MicrosoftDNS&quot;)<br />Set objItem = objWMIService.Get(&quot;MicrosoftDNS_NSType&quot;)<br />&nbsp; &nbsp;errResult = objItem.CreateInstanceFromPropertyData _<br />&nbsp; &nbsp; &nbsp; &nbsp;(strDNSServer, strContainer, strOwner, intRecordClass, intTTL, strNSHost)</p></span></td></tr></tbody></table>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/876.htm</link>
<title><![CDATA[修改系统安装序列号]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 30 Jul 2005 04:47:20 +0000</pubDate> 
<guid>https://maytide.net/read.php/876.htm</guid> 
<description>
<![CDATA[ 
	ON ERROR RESUME NEXT <p></p><p>Dim VOL_PROD_KEY<br />if Wscript.arguments.count&lt;1 then<br />&nbsp;&nbsp; VOL_PROD_KEY=InputBox(&quot;换号脚本&quot;&amp;vbCr&amp;vbCr&amp;&quot;&nbsp;&nbsp;&nbsp; 本程序将自动替换你当前 Windows 的序列号,通过微软验证完全正版。&quot;&amp;vbCr&amp;vbCr&amp;&quot;序列号(OEM版无效,默认版本为 XP VLK)：&quot;,&quot;Windows XP序列号自动更换器&quot;,&quot;XXXXX-XXXXX-XXXXX-XXXXX-XXXXX&quot;)<br />&nbsp;&nbsp; if VOL_PROD_KEY=&quot;&quot; then<br />&nbsp;&nbsp;&nbsp;&nbsp; Wscript.quit<br />&nbsp;&nbsp; end if<br />else<br />&nbsp;&nbsp; VOL_PROD_KEY = Wscript.arguments.Item(0)<br />end if</p><p>VOL_PROD_KEY = Replace(VOL_PROD_KEY,&quot;-&quot;,&quot;&quot;) 'remove hyphens if any</p><p>for each Obj in GetObject(&quot;winmgmts:&#123; impersonationLevel=impersonate &#125;&quot;).InstancesOf (&quot;win32_WindowsProductActivation&quot;)</p><p>&nbsp;&nbsp; result = Obj.SetProductKey (VOL_PROD_KEY)</p><p>&nbsp;&nbsp; if err = 0 then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Wscript.echo &quot;完成更换，请重新进行正版验证&quot;<br />&nbsp;&nbsp; end if</p><p>&nbsp;&nbsp; if err &lt;&gt; 0 then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Wscript.echo &quot;替换失败！输入的 CD-KEY 与当前的版本不匹配。&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Err.Clear<br />&nbsp;&nbsp; end if</p><p>Next</p>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/874.htm</link>
<title><![CDATA[备份和清除大型事件日志]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 02:02:35 +0000</pubDate> 
<guid>https://maytide.net/read.php/874.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong></p></div><div><p>如果事件日志文件的大小大于 20 MB，就将其备份和清除。</p></div><div><p><br /><strong>脚本代码<br /></strong>strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&quot; _<br />&nbsp; &nbsp;&amp; &quot;&#123; impersonationLevel=impersonate, (Backup, Security) &#125;!&#92;&#92;&quot; _<br />&nbsp; &nbsp; &nbsp; &nbsp;&amp; strComputer &amp; &quot;&#92;root&#92;cimv2&quot;)<br />Set colLogFiles = objWMIService.ExecQuery _<br />&nbsp; &nbsp;(&quot;Select * from Win32_NTEventLogFile&quot;)<br />For each objLogfile in colLogFiles<br />&nbsp; &nbsp;If objLogFile.FileSize &gt; 100000 Then<br />&nbsp; &nbsp; &nbsp; strBackupLog = objLogFile.BackupEventLog _<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (&quot;c:&#92;scripts&#92;&quot; &amp; objLogFile.LogFileName &amp; &quot;.evt&quot;)<br />&nbsp; &nbsp; &nbsp; objLogFile.ClearEventLog()<br />&nbsp; &nbsp;End If<br />Next</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/875.htm</link>
<title><![CDATA[备份和清除事件日志]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 02:02:26 +0000</pubDate> 
<guid>https://maytide.net/read.php/875.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong></p></div><div><p>备份和清除应用程序事件日志。</p></div><div><p><br /><strong>脚本代码<br /></strong>strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&quot; _<br />&nbsp; &nbsp;&amp; &quot;&#123; impersonationLevel=impersonate,(Backup) &#125;!&#92;&#92;&quot; &amp; _<br />&nbsp; &nbsp; &nbsp; &nbsp;strComputer &amp; &quot;&#92;root&#92;cimv2&quot;)<br />Set colLogFiles = objWMIService.ExecQuery _<br />&nbsp; &nbsp;(&quot;Select * from Win32_NTEventLogFile where LogFileName='Application'&quot;)<br />For Each objLogfile in colLogFiles<br />&nbsp; &nbsp;errBackupLog = objLogFile.BackupEventLog(&quot;c:&#92;scripts&#92;application.evt&quot;)<br />&nbsp; &nbsp;If errBackupLog &lt;&gt; 0 Then &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp;Wscript.Echo &quot;The Application event log could not be backed up.&quot;<br />&nbsp; &nbsp;Else<br />&nbsp; &nbsp; &nbsp; &nbsp;objLogFile.ClearEventLog()<br />&nbsp; &nbsp;End If<br />Next</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/873.htm</link>
<title><![CDATA[配置静态 IP 地址]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 02:00:48 +0000</pubDate> 
<guid>https://maytide.net/read.php/873.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong></p></div><div><p>将计算机的 IP 地址设置为 192.168.1.141，并将 IP 网关设置为 192.168.1.100。</p></div><div><p></p><p><br /><strong>脚本代码<br /></strong>strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&#92;&#92;&quot; &amp; strComputer &amp; &quot;&#92;root&#92;cimv2&quot;)<br />Set colNetAdapters = objWMIService.ExecQuery _<br />&nbsp; &nbsp;(&quot;Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE&quot;)<br />strIPAddress = Array(&quot;192.168.1.141&quot;)<br />strSubnetMask = Array(&quot;255.255.255.0&quot;)<br />strGateway = Array(&quot;192.168.1.100&quot;)<br />strGatewayMetric = Array(1)<br />For Each objNetAdapter in colNetAdapters<br />&nbsp; &nbsp;errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)<br />&nbsp; &nbsp;errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)<br />&nbsp; &nbsp;If errEnable = 0 Then<br />&nbsp; &nbsp; &nbsp; &nbsp;WScript.Echo &quot;The IP address has been changed.&quot;<br />&nbsp; &nbsp;Else<br />&nbsp; &nbsp; &nbsp; &nbsp;WScript.Echo &quot;The IP address could not be changed.&quot;<br />&nbsp; &nbsp;End If<br />Next</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/872.htm</link>
<title><![CDATA[创建主机地址 (A) DNS 记录]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:59:59 +0000</pubDate> 
<guid>https://maytide.net/read.php/872.htm</guid> 
<description>
<![CDATA[ 
	<table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td valign="top"><span><div><p><strong>描述</strong></p></div><div><p>在 DNS 服务器上创建主机地址 (A) 记录。</p></div><div><p>有关在这段代码中使用的 CreateInstanceFromPropertyData 方法的更多信息，请单击<a href="http://msdn.microsoft.com/library/en-us/dns/dns/microsoftdns_atype_createinstancefrompropertydata.asp"><span style="color: #666666">此处</span></a>。</p></div><div><p><strong><br />支持平台</strong></p></div><table border="0" cellspacing="0" cellpadding="0" class="dataTable" id="EFAA"><thead></thead><tbody><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows Server 2003</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows XP</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>否（然而，可以在 Windows XP 计算机上对远程 DNS 服务器运行脚本）</strong></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows 2000</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是，需要安装 DNS WMI 提供程序</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows NT 4.0</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>否</strong></p></td></tr></tbody></table><div><p></p><p><br /><strong>脚本代码<br /></strong>strDNSServer = &quot;atl-dc-03.fabrikam.com&quot;<br />strContainer = &quot;fabrikam.com&quot;<br />strOwner = &quot;workstation5.fabrikam.com&quot;<br />intRecordClass = 1<br />intTTL = 600<br />strIPAddress = &quot;192.168.1.100&quot;<br />strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&#92;&#92;&quot; &amp; strComputer &amp; &quot;&#92;root&#92;MicrosoftDNS&quot;)<br />Set objItem = objWMIService.Get(&quot;MicrosoftDNS_AType&quot;)<br />errResult = objItem.CreateInstanceFromPropertyData _<br />&nbsp; &nbsp;(strDNSServer, strContainer, strOwner, intRecordClass, intTTL, strIPAddress)</p></div></span></td></tr></tbody></table>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/871.htm</link>
<title><![CDATA[创建邮件交换器 (MX) DNS 记录]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:58:56 +0000</pubDate> 
<guid>https://maytide.net/read.php/871.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong></p></div><div><p>在 DNS 服务器上创建邮件交换器 (MX) DNS 记录。</p></div><div><p>有关在这段代码中使用的 CreateInstanceFromPropertyData 方法的更多信息，请单击<a href="http://msdn.microsoft.com/library/en-us/dns/dns/microsoftdns_mxtype_createinstancefrompropertydata.asp"><span style="color: #666666">此处</span></a>。</p></div><div><p><strong><br />支持平台</strong></p></div><table border="0" cellspacing="0" cellpadding="0" class="dataTable" id="EFAA"><thead></thead><tbody><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows Server 2003</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows XP</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>否（然而，可以在 Windows XP 计算机上对远程 DNS 服务器运行脚本）</strong></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows 2000</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是，需要安装 DNS WMI 提供程序</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows NT 4.0</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>否</strong></p></td></tr></tbody></table><div><p></p><p><br /><strong>脚本代码<br /></strong>strDNSServer = &quot;atl-dc-03.fabrikam.com&quot;<br />strContainer = &quot;fabrikam.com&quot;<br />strOwner = &quot;atl-srv-01.fabrikam.com&quot;<br />intRecordClass = 1<br />intTTL = 600<br />intPreference = 0<br />strMailExchanger = &quot;mailexchanger.fabrikam.com&quot;<br />strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&#92;&#92;&quot; &amp; strComputer &amp; &quot;&#92;root&#92;MicrosoftDNS&quot;)<br />Set objItem = objWMIService.Get(&quot;MicrosoftDNS_MXType&quot;)<br />errResult = objItem.CreateInstanceFromPropertyData _<br />&nbsp; &nbsp;(strDNSServer, strContainer, strOwner, intRecordClass, intTTL, intPreference, strMailExchanger)</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/870.htm</link>
<title><![CDATA[创建主要 DNS 区域]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:57:24 +0000</pubDate> 
<guid>https://maytide.net/read.php/870.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong></p></div><div><p>在 DNS 服务器上创建名为 accounting.fabrikam.com 的主要 DNS 区域。</p></div><div><p>有关在这段代码中使用的 CreateZone 方法的更多信息，请单击<a href="http://msdn.microsoft.com/library/en-us/dns/dns/microsoftdns_zone_createzone.asp">此处</a>。</p></div><div><p><strong><br />支持平台</strong></p></div><table border="0" cellspacing="0" cellpadding="0" class="dataTable" id="EFAA"><thead></thead><tbody><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows Server 2003</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows XP</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>否（然而，可以在 Windows XP 计算机上对远程 DNS 服务器运行脚本）</strong></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows 2000</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是，需要安装 DNS WMI 提供程序</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows NT 4.0</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>否</strong></p></td></tr></tbody></table><div><p></p><p><br /><strong>脚本代码<br /></strong>strZoneName = &quot;accounting.fabrikam.com&quot;<br />intPrimaryZone = 1<br />strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&#92;&#92;&quot; &amp; strComputer &amp; &quot;&#92;root&#92;MicrosoftDNS&quot;)<br />Set objItem = objWMIService.Get(&quot;MicrosoftDNS_Zone&quot;)<br />errResult = objItem.CreateZone(strZoneName, intPrimaryZone)</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/869.htm</link>
<title><![CDATA[启用网络适配器上的 IPSec]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:54:35 +0000</pubDate> 
<guid>https://maytide.net/read.php/869.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong></p></div><div><p>启用网络适配器的 IP 安全性。在此脚本中，所有的l TCP 和 UDP 端口以及所有的l IP 协议都是允许的；因此在每种情况下都传送值 0。如果只允许特定的端口或协议，则应该以数组的形式发送这些值。</p></div><div><p>有关在这段代码中使用的 EnableIPSec 方法的更多信息，请单击 <a href="http://msdn.microsoft.com/library/en-us/wmisdk/wmi/enableipsec_method_in_class_win32_networkadapterconfiguration.asp"><span style="color: #666666">此处</span></a>。</p></div><div><p><strong><br />支持平台</strong></p></div><table border="0" cellspacing="0" cellpadding="0" class="dataTable" id="EFAA"><thead></thead><tbody><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows Server 2003</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows XP</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows 2000</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows NT 4.0</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>Yes, with WMI installed</strong></p></td></tr></tbody></table><div><p></p><p><br /><strong>脚本代码<br /></strong>On Error Resume Next<br />Const ALLOW_ALL = 0<br />strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&#92;&#92;&quot; &amp; strComputer &amp; &quot;&#92;root&#92;cimv2&quot;)<br />Set colNetCards = objWMIService.ExecQuery _<br />&nbsp; &nbsp;(&quot;Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True&quot;)<br />For Each objNetCard in colNetCards<br />&nbsp; &nbsp;arrPermittedTCPPorts = Array(ALLOW_ALL)<br />&nbsp; &nbsp;arrPermittedUDPPorts = Array(ALLOW_ALL)<br />&nbsp; &nbsp;arrPermittedIPProtocols = Array(ALLOW_ALL)<br />&nbsp; &nbsp;objNetCard.EnableIPSec arrPermittedTCPPorts, arrPermittedUDPPorts, arrPermittedIPProtocols<br />Next<br /><br /></p><hr /><br /><strong>EnableIPSec Method of the Win32_NetworkAdapterConfiguration Class：<br /><br />uint32 EnableIPSec(&nbsp; <p></p><pre class="syntax"><strong>string IPSecPermitTCPPorts[],&nbsp; </strong></pre><pre class="syntax"><strong>string IPSecPermitUDPPorts[],&nbsp; </strong></pre><pre class="syntax"><strong>string IPSecPermitIPProtocols[]</strong></pre><pre class="syntax"><strong>);</strong></pre></strong></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/868.htm</link>
<title><![CDATA[确定计算机的 IP 地址]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:51:02 +0000</pubDate> 
<guid>https://maytide.net/read.php/868.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong></p></div><div><p>返回安装在计算机中的每个支持 IP 的网络适配器的 IP 地址。</p></div><div><p><br /><strong>脚本代码<br /></strong>strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&#92;&#92;&quot; &amp; strComputer &amp; &quot;&#92;root&#92;cimv2&quot;)<br />Set IPConfigSet = objWMIService.ExecQuery _<br />&nbsp; &nbsp;(&quot;Select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE&quot;)<br />For Each IPConfig in IPConfigSet<br />&nbsp; &nbsp;If Not IsNull(IPConfig.IPAddress) Then <br />&nbsp; &nbsp; &nbsp; &nbsp;For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WScript.Echo IPConfig.IPAddress(i)<br />&nbsp; &nbsp;Next<br />&nbsp; &nbsp;End If<br />Next</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/867.htm</link>
<title><![CDATA[配置服务启动选项]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:46:06 +0000</pubDate> 
<guid>https://maytide.net/read.php/867.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong><br />禁用所有配置为手动启动的服务。除了别的之外，这会使得 Power User 不能启动这些服务。</p></div><div><p><br /><strong>脚本代码<br /></strong>strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&quot; _<br />&amp; &quot;&#123; impersonationLevel=impersonate &#125;!&#92;&#92;&quot; &amp; strComputer &amp; &quot;&#92;root&#92;cimv2&quot;)<br />Set colServiceList = objWMIService.ExecQuery _<br />(&quot;Select * from Win32_Service where StartMode = 'Manual'&quot;)<br />For Each objService in colServiceList<br />errReturnCode = objService.Change( , , , , &quot;Disabled&quot;) &nbsp; <br />Next</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/866.htm</link>
<title><![CDATA[确定在某个进程中运行的服务]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:45:56 +0000</pubDate> 
<guid>https://maytide.net/read.php/866.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong><br />返回在 Services.exe 进程中运行的服务的列表。</p></div><div><p><br /><strong>脚本代码<br /></strong>strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&quot; _<br />&amp; &quot;&#123; impersonationLevel=impersonate &#125;!&#92;&#92;&quot; &amp; strComputer &amp; &quot;&#92;root&#92;cimv2&quot;)<br />Set colListOfServices = objWMIService.ExecQuery _<br />(&quot;Select * from Win32_Service&quot;)<br />For Each objService in colListOfServices<br />If objService.PathName = &quot;C:&#92;WINDOWS&#92;system32&#92;services.exe&quot; Then<br />Wscript.Echo objService.DisplayName<br />End If<br />Next</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/865.htm</link>
<title><![CDATA[确定在所有进程中运行的服务]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:44:24 +0000</pubDate> 
<guid>https://maytide.net/read.php/865.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong><br />返回进程列表以及当前在每个进程中运行的所有服务。</p></div><div><p><br /><strong>脚本代码<br /></strong>set objIdDictionary = CreateObject(&quot;Scripting.Dictionary&quot;)<br />strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&quot; _<br />&amp; &quot;&#123; impersonationLevel=impersonate &#125;!&#92;&#92;&quot; &amp; strComputer &amp; &quot;&#92;root&#92;cimv2&quot;)<br />Set colServices = objWMIService.ExecQuery _<br />(&quot;Select * from Win32_Service Where State &lt;&gt; 'Stopped'&quot;)<br />For Each objService in colServices<br />If objIdDictionary.Exists(objService.ProcessID) Then<br />Else<br />objIdDictionary.Add objService.ProcessID, objService.ProcessID<br />End If<br />Next<br />colProcessIDs = objIdDictionary.Items<br />For i = 0 to objIdDictionary.Count - 1<br />Set colServices = objWMIService.ExecQuery _<br />(&quot;Select * from Win32_Service Where ProcessID = '&quot; &amp; _<br />colProcessIDs(i) &amp; &quot;'&quot;)<br />Wscript.Echo &quot;Process ID: &quot; &amp; colProcessIDs(i)<br />For Each objService in colServices<br />Wscript.Echo VbTab &amp; objService.DisplayName <br />Next<br />Next</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/863.htm</link>
<title><![CDATA[确定可以停止的服务]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:43:40 +0000</pubDate> 
<guid>https://maytide.net/read.php/863.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong><br />返回可以停止的服务的列表。</p></div><div><p><br /><strong>脚本代码<br /></strong>strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&quot; _<br />&amp; &quot;&#123; impersonationLevel=impersonate &#125;!&#92;&#92;&quot; &amp; strComputer &amp; &quot;&#92;root&#92;cimv2&quot;)<br />Set colServices = objWMIService.ExecQuery _<br />(&quot;Select * from Win32_Service Where AcceptStop = True&quot;)<br />For Each objService in colServices<br />Wscript.Echo objService.DisplayName <br />Next</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/864.htm</link>
<title><![CDATA[确定可以暂停的服务]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:43:31 +0000</pubDate> 
<guid>https://maytide.net/read.php/864.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong><br />返回可以暂停的服务的列表。</p></div><div><p><br /><strong>脚本代码<br /></strong>strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&quot; _<br />&amp; &quot;&#123; impersonationLevel=impersonate &#125;!&#92;&#92;&quot; &amp; strComputer &amp; &quot;&#92;root&#92;cimv2&quot;)<br />Set colServices = objWMIService.ExecQuery _<br />(&quot;Select * from Win32_Service Where AcceptPause = True&quot;)<br />For Each objService in colServices<br />Wscript.Echo objService.DisplayName <br />Next</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/862.htm</link>
<title><![CDATA[删除服务]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:42:55 +0000</pubDate> 
<guid>https://maytide.net/read.php/862.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong><br />删除名为 DbService 的假定服务。<br /></p></div><div><p><br /><strong>脚本代码<br /></strong>strComputer = &quot;.&quot;<br />Set objWMIService = GetObject(&quot;winmgmts:&quot; _<br />&amp; &quot;&#123; impersonationLevel=impersonate &#125;!&#92;&#92;&quot; &amp; strComputer &amp; &quot;&#92;root&#92;cimv2&quot;)<br />Set colListOfServices = objWMIService.ExecQuery _<br />(&quot;Select * from Win32_Service Where Name = 'DbService'&quot;)<br />For Each objService in colListOfServices<br />objService.StopService()<br />objService.Delete()<br />Next</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/861.htm</link>
<title><![CDATA[将 1,000 个用户添加到安全组]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:25:12 +0000</pubDate> 
<guid>https://maytide.net/read.php/861.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述<br /></strong><br />演示脚本创建一个名为 Group1 的安全组，并且将一千个用户（UserNo1 到 UserNo10000）添加到该组。此脚本不可用于生产环境。</p></div><div><p>有关使用 ADSI 创建对象的更多信息，请单击 <a href="http://msdn.microsoft.com/library/en-us/netdir/adsi/creating_and_deleting_objects.asp">此处</a>。<br /></p></div><div><p><strong><br />支持平台</strong></p></div><table border="0" cellspacing="0" cellpadding="0" class="dataTable" id="EFAA"><thead></thead><tbody><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows Server 2003</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows XP</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows 2000</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows NT 4.0</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是，需要安装 Active Directory Client Extensions</strong></p></td></tr></tbody></table><div><p></p><p><br /><strong>脚本代码<br /></strong>Const ADS_PROPERTY_APPEND = 3<br />Set objRootDSE = GetObject(&quot;LDAP://rootDSE&quot;)<br />Set objContainer = GetObject(&quot;LDAP://cn=Users,&quot; &amp; _<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; objRootDSE.Get(&quot;defaultNamingContext&quot;))<br />Set objGroup = objContainer.Create(&quot;Group&quot;, &quot;cn=Group1&quot;)<br />objGroup.Put &quot;sAMAccountName&quot;,&quot;Group1&quot;<br />objGroup.SetInfo<br />For i = 1 To 1000<br />strDN = &quot;,cn=Users,&quot; &amp; objRootDSE.defaultNamingContext<br />&nbsp;objGroup.PutEx ADS_PROPERTY_APPEND, &quot;member&quot;, _<br />&nbsp; &nbsp;Array(&quot;cn=UserNo&quot; &amp; i &amp; strDN)<br />&nbsp;objGroup.SetInfo<br />Next<br />WScript.Echo &quot;Group1 created and 1000 Users added to the group.&quot;</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/860.htm</link>
<title><![CDATA[更改 Windows 本地管理员密码]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:22:45 +0000</pubDate> 
<guid>https://maytide.net/read.php/860.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong><br /><br />绑定到计算机 MyComputer 上的本地管理员帐户，并且将该帐户的密码更改为 <em>testpassword</em>。</p></div><div><p>有关使用本地用户帐户的详细信息，请单击 <a href="http://msdn.microsoft.com/library/en-us/netdir/adsi/users.asp">此处</a>。</p></div><div><p><strong><br />支持平台</strong></p></div><table border="0" cellspacing="0" cellpadding="0" class="dataTable" id="EFAA"><thead></thead><tbody><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows XP</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows Server 2003</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows 2000</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows NT 4.0</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是，需要安装</strong><a href="http://www.microsoft.com/windows2000/server/evaluation/news/bulletins/adextension.asp">Active Directory Client Extensions</a></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows 98</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是，需要安装</strong><a href="http://www.microsoft.com/windows2000/server/evaluation/news/bulletins/adextension.asp">Active Directory Client Extensions</a></p></td></tr></tbody></table><div><p><br /><strong>脚本代码<br /></strong>strComputer = &quot;MyComputer&quot;<br />Set objUser = GetObject(&quot;WinNT://&quot; &amp; strComputer &amp; &quot;/Administrator, user&quot;)<br />objUser.SetPassword &quot;testpassword&quot;<br />objUser.SetInfo</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/859.htm</link>
<title><![CDATA[创建 1,000 个用户帐户]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:20:26 +0000</pubDate> 
<guid>https://maytide.net/read.php/859.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong><br />演示脚本在 Active Directory 内的用户容器中创建 1,000 个用户帐户（名为 UserNo1、UserNo2、UserNo3 等等）。此脚本用于测试需要多个用户帐户的方案。<br /></p></div><div><p><br /><strong>脚本代码<br /></strong>Set objRootDSE = GetObject(&quot;LDAP://rootDSE&quot;)<br />Set objContainer = GetObject(&quot;LDAP://cn=Users,&quot; &amp; _<br />objRootDSE.Get(&quot;defaultNamingContext&quot;))<br />For i = 1 To 1000<br />Set objLeaf = objContainer.Create(&quot;User&quot;, &quot;cn=UserNo&quot; &amp; i)<br />objLeaf.Put &quot;sAMAccountName&quot;, &quot;UserNo&quot; &amp; i<br />objLeaf.SetInfo<br />Next<br />WScript.Echo &quot;1000 Users created.&quot;</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/858.htm</link>
<title><![CDATA[要求更改密码]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:16:39 +0000</pubDate> 
<guid>https://maytide.net/read.php/858.htm</guid> 
<description>
<![CDATA[ 
	<table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td valign="top"><span><div><p><strong>描述<br /></strong><br />强制要求用户在下一次登录时更改密码。</p></div><div><p><strong><br />脚本代码</strong></p></div></span></td></tr></tbody></table><br />Set objUser = GetObject _<br />(&quot;LDAP://CN=myerken,OU=management,DC=Fabrikam,DC=com&quot;)<br />objUser.Put &quot;pwdLastSet&quot;, 0<br />objUser.SetInfo
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/857.htm</link>
<title><![CDATA[设置用户密码]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:15:46 +0000</pubDate> 
<guid>https://maytide.net/read.php/857.htm</guid> 
<description>
<![CDATA[ 
	<span>&nbsp;<strong>描述</strong><br />为用户配置新密码。 <div><p><br /><strong>脚本代码<br /></strong>Set objUser = GetObject _<br />(&quot;LDAP://cn=MyerKen,ou=management,dc=fabrikam,dc=com&quot;)<br />objUser.SetPassword &quot;i5A2sj*!&quot;</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/856.htm</link>
<title><![CDATA[设置本地用户帐户的过期日期]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:13:01 +0000</pubDate> 
<guid>https://maytide.net/read.php/856.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>描述</strong><br /><br />绑定到名为 atl-win2k-01 的计算机上的本地用户帐户，并且将帐号配置为在 2003 年 3 月 1 日过期。</p></div><div><p>有关使用本地用户帐户的详细信息，请单击<a href="http://msdn.microsoft.com/library/en-us/netdir/adsi/users.asp"><span style="color: #666666">此处</span></a>。</p></div><div><p><strong><br />支持平台</strong></p></div><table border="0" cellspacing="0" cellpadding="0" class="dataTable" id="EFAA"><thead></thead><tbody><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows XP</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows Server 2003</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows 2000</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows NT 4.0</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是，需要安装</strong><a href="http://www.microsoft.com/windows2000/server/evaluation/news/bulletins/adextension.asp"><span style="color: #666666">Active Directory Client Extensions</span></a></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows 98</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是，需要安装</strong><a href="http://www.microsoft.com/windows2000/server/evaluation/news/bulletins/adextension.asp"><span style="color: #666666">Active Directory Client Extensions</span></a></p></td></tr></tbody></table><div class="dataTableBottomMargin"></div><div><p><strong></strong></p><p><br /><strong>脚本代码<br /><br /></strong>strComputer = &quot;atl-win2k-01&quot;<br />Set objUser = GetObject(&quot;WinNT:// &quot; &amp; strComputer &amp; &quot;/kenmyer &quot;)<br />objUser.AccountExpirationDate = #03/01/2003#<br />objUser.SetInfo</p></div></span>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/854.htm</link>
<title><![CDATA[将 Command Prompt Here 添加到 Windows Explorer]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:10:43 +0000</pubDate> 
<guid>https://maytide.net/read.php/854.htm</guid> 
<description>
<![CDATA[ 
	<div><p>将&rsquo; <strong>Command Prompt Here</strong> &rsquo;命令添加到 Windows Explorer 系统菜单。如果用户从系统菜单中选择&lsquo; <strong>Command Prompt Here</strong> &rsquo;，将弹出一个命令窗口，在与当前的 Windows Explorer 文件夹相同的文件夹中打开。<br /></p></div><div><p><br />有关使用 Windows Script Host 写入注册表的信息，请单击 <a href="http://msdn.microsoft.com/library/en-us/script56/html/wsmthregwrite.asp">此处</a>。</p></div><div><p><strong><br />支持平台</strong></p></div><table border="0" cellspacing="0" cellpadding="0" class="dataTable" id="EFAA"><thead></thead><tbody><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows XP</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows Server 2003</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows 2000</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows NT 4.0</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows 98</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是，但是需要将 cmd.exe 更改为 command.com</strong></p></td></tr></tbody></table><br /><div><p></p><p><strong>脚本代码<br /></strong><br />Set objShell = CreateObject(&quot;WScript.Shell&quot;)<br />objShell.RegWrite &quot;HKCR&#92;Folder&#92;Shell&#92;MenuText&#92;Command&#92;&quot;, &quot;cmd.exe /k cd &quot; &amp; chr(34) &amp; &quot;%1&quot; &amp; chr(34)<br />objShell.RegWrite &quot;HKCR&#92;Folder&#92;Shell&#92;MenuText&#92;&quot;, &quot;Command Prompt Here&quot;</p></div>
]]>
</description>
</item><item>
<link>https://maytide.net/read.php/855.htm</link>
<title><![CDATA[将计算机加入到域中]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[PowerShell 和脚本]]></category>
<pubDate>Sat, 09 Jul 2005 01:03:41 +0000</pubDate> 
<guid>https://maytide.net/read.php/855.htm</guid> 
<description>
<![CDATA[ 
	<span><div><p><strong>说明</strong></p></div><div><p><br />将本地计算机加入到域中，然后在 Active Directory 中创建该计算机的帐户。 </p></div><div><p><strong><br />支持的平台</strong></p></div><table border="0" cellspacing="0" cellpadding="0" class="dataTable" id="EFAA"><thead></thead><tbody><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows Server 2003</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows XP</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>是</strong></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows 2000</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>否</strong></p></td></tr><tr class="evenRecord" valign="top"><td><p class="lastInCell"><strong>Windows NT 4.0</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>否</strong></p></td></tr><tr class="record" valign="top"><td><p class="lastInCell"><strong>Windows 98</strong></p></td><td style="border-right: #cccccc 1px solid"><p class="lastInCell"><strong>否</strong></p></td></tr></tbody></table><div><p></p><p><br /><strong>脚本代码<br /><br /></strong>Const JOIN_DOMAIN = 1<br />Const ACCT_CREATE = 2<br />Const ACCT_DELETE = 4<br />Const WIN9X_UPGRADE = 16<br />Const DOMAIN_JOIN_IF_JOINED = 32<br />Const JOIN_UNSECURE = 64<br />Const MACHINE_PASSWORD_PASSED = 128<br />Const DEFERRED_SPN_SET = 256<br />Const INSTALL_INVOCATION = 262144<br /><br />strDomain = &quot;FABRIKAM&quot;<br />strPassword = &quot;ls4k5ywA&quot;<br />strUser = &quot;shenalan&quot;<br /><br />Set objNetwork = CreateObject(&quot;WScript.Network&quot;)<br />strComputer = objNetwork.ComputerName<br /><br />Set objComputer = GetObject(&quot;winmgmts:&#123; impersonationLevel=Impersonate &#125;!&#92;&#92;&quot; &amp; _<br />strComputer &amp; &quot;&#92;root&#92;cimv2:Win32_ComputerSystem.Name='&quot; &amp; _<br />strComputer &amp; &quot;'&quot;)<br /><br />ReturnValue = objComputer.JoinDomainOrWorkGroup(strDomain, _<br />strPassword, strDomain &amp; &quot;&#92;&quot; &amp; strUser, NULL, _<br />JOIN_DOMAIN + ACCT_CREATE)</p></div></span>
]]>
</description>
</item>
</channel>
</rss>