在 Windows Server 2003 上更新每个配置文件的注册表 [英] Updating every profile's registry on Windows Server 2003
问题描述
我有一个用于终端服务的 Windows Server 2003 系统.我们不使用漫游配置文件.我们不使用登录脚本.我有大约三十到四十个帐户登录到这个系统,因此有本地配置文件.
I have a Windows Server 2003 system that is used for terminal services. We do not use roaming profiles. We do not use login scripts. I have about thirty to fourty accounts that log into this system and as such have local profiles.
安装在此系统上的软件包之一使用 HKCU/软件注册树进行许可,因此每个用户在其本地配置文件中都有许可证密钥.
One of the software packages that are installed onto this system uses HKCU/Software reg tree for its licensing and so each user has the license key in their local profile.
如何以一种确定性的方式更新所有这些不同的配置文件注册表?
How can I update all of these different profiles registries in a deterministic manner?
推荐答案
<小时>
有多种方法可以实现您的愿望 - 一种比另一种笨拙.终端服务器可能是部署噩梦 - 用户可能无权运行 msiexec.exe,因此 MSI 自我修复可能会失败.这就是为什么我通常更喜欢使用批处理文件、脚本或reg文件来处理您面临的情况.
There are several ways to achieve what you want - one clunkier than the other. Terminal servers can be a deployment nightmare - users may not have rights to run msiexec.exe and hence MSI self-repair could fail. That's why I generally prefer to use batch files, scripts or reg files for the kind of situation you are facing.
我会使用 Microsoft 的Active Setup 功能.这只是一个功能的奇特名称,它允许您在登录时为每个配置文件运行一次".这是一个很好的解释:http://www.etlengineering.com/installer/activesetup.txt
I would use Microsoft's Active Setup feature. This is just a fancy name for a feature which allows you to "run something once per profile on login". Here is a good explanation: http://www.etlengineering.com/installer/activesetup.txt
以下是 MSI 文件的示例活动设置条目(这是 *.reg 文件的内容):
Here is a sample active-setup entry for an MSI file (this is the content of a *.reg file):
REGEDIT4
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftActive SetupInstalled Components[ProductCode]]
"StubPath"="[SystemFolder]msiexec.exe /q /fou [ProductCode]"
StubPath"命令可以是任何可运行的"命令,在您的情况下,我建议不要运行 msiexec.exe,而是通过 cscript.exe 或其他一些批处理机制(CMD、REG 等...)运行 vbscript.原因就是我上面说的:msiexec.exe 可能不允许终端服务器用户运行.换句话说,是这样的:
The "StubPath" command can be anything "runnable", and in your case I would suggest not running msiexec.exe but rather a vbscript via cscript.exe or some other batch mechanism (CMD, REG, Etc...). The reason is what I stated above: msiexec.exe may not be allowed to run for terminal server users. In other words, something like this:
REGEDIT4
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftActive SetupInstalled ComponentsMyProduct]
"StubPath"="[SystemFolder]cmd.exe /k C:SomeScript.cmd"
<小时>
还有其他方法可以将数据添加到每个用户的个人资料中,例如 使用宣传的 MSI 快捷方式和自我修复,但我不建议将其用于终端服务器.有关使用 MSI 文件进行注册表设置的问题的信息,请参阅此 serverfault.com 答案.
这篇关于在 Windows Server 2003 上更新每个配置文件的注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!