相关: 如何在Windows 7 / 2k8中通过无线启用域身份验证?
要测试我试图在上述问题中设置的通过无线连接的域登录,我需要一个尚未在本地系统上缓存其域凭据的帐户。不幸的是,我办公室里只有这么多人可以帮助我测试这一点,即使那样,我也不想打扰他们。因此,我希望能够在每次登录后清除自己的缓存凭据。
如何清除本地缓存,同时仍保留将来缓存凭据的功能?
相关: 如何在Windows 7 / 2k8中通过无线启用域身份验证?
要测试我试图在上述问题中设置的通过无线连接的域登录,我需要一个尚未在本地系统上缓存其域凭据的帐户。不幸的是,我办公室里只有这么多人可以帮助我测试这一点,即使那样,我也不想打扰他们。因此,我希望能够在每次登录后清除自己的缓存凭据。
如何清除本地缓存,同时仍保留将来缓存凭据的功能?
Answers:
David Yu的答案几乎是针对性的,但是有一种方法可以直接编辑注册表。同样,这仅在未由GPO配置该设置的情况下有效。
首先,我想指出缓存的凭据数据的存储位置。这将有助于演示(并用于故障排除目的,验证)配置更改的效果。
警告: 我在Internet上的多个地方都找到了此信息,其中大多数建议不要手动修改这些值。
甚至对于管理员来说,用于存储缓存的域登录名的注册表项也是隐藏的。它只能由SYSTEM帐户访问。因此,要查看该文件,您将需要一个工具psexec
(可从Microsoft获得,但默认情况下未安装),该工具将允许您以regedit
SYSTEM 身份运行。执行此操作的命令行(假设已安装,并且在您的%PATH%
)为:
psexec -d -i -s regedit
进入那里后,导航至HKLM\SECURITY\Cache\
。在这里,您应该看到几个BINARY值。对于可用于缓存凭据的每个插槽,将有一个名为NL $ Control的名称,其他名为NL $ ##的名称。(预设10)
再一次,我想在此强调,您不应该手动修改或删除此键或其值。
那么,既然我们知道了数据的缓存位置,并且不应该在此处触摸数据,那么如何清除它?
同样,David Yu的答案将为您指向正确的注册表项。但是,如果您不想直接修改注册表,则可以通过本地安全策略执行另一种方法。
secpol.msc
在“安全设置”树中,导航到Local Policies\Security Options
。这将是一个名为的政策Interactive logon: Number of previous logons to cache (in case domain controller is not available)
。
默认情况下设置为10 logons
。要清除缓存,请将其设置为零,然后单击“确定”。在Server 2008上,这将立即生效。对于Server 2003,您将需要重新启动。可以在HKLM\SECURITY\Cache\
不再有任何NL $ ##值的地方看到影响。
要重新启用凭据缓存,请编辑相同的策略以反映您的首选值,然后单击“确定”。同样,如果您使用的是Server 2008,这将立即生效。Server 2003将需要重新启动。请注意,如果您在Server 2008上执行此操作,但尚未注销或重新引导,则可以看到缓存插槽已还原,但其中没有实际数据。
如果只想对需要暂时禁用的凭据缓存的功能进行一次快速的一次性检查,则在Server 2008中执行此操作而不注销或重新启动可能会很有用。它还有助于确保您下次登录后不会忘记还原更改。
您可以修改系统的注册表以禁用缓存的登录凭据。将注册表项设置为0。这将需要在每次更改后重新启动。这也假设您没有设置此密钥的GPO。
HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Windows NT \当前版本\ Winlogon \
ValueName:CachedLogonsCount
资料类型:REG_SZ
值:0-50
通过将所有NL $条目设置为与上一个相同的密码,我可以清除所有存储的密码(最后几个NL $条目相同,因此看起来它们只是占位符)。我在Windows 7 PRO 64位计算机上进行了此测试,但尚未在其他任何设备上进行过测试。
只需将以下内容复制到记事本中,并将其另存为.reg,然后运行
regedit / s yourfilename.reg
作为系统帐户。
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SECURITY\Cache]
"NL$1"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"NL$2"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"NL$3"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"NL$4"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"NL$5"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"NL$6"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"NL$7"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"NL$8"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"NL$9"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"NL$10"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
删除存储的凭据的最简便方法是运行MSTSC,然后输入要缓存的终端服务器的名称或IP地址。如果将其缓存为完全限定的域名(即必须输入的域名),则可能会为您以及域\用户名填写该字段。然后单击选项。如果存储了凭据,则可以编辑或删除它们。
为了防止系统缓存凭据,请使用记事本编辑RDP文件,并将PromptCredentialOnce:i:1参数更改为PromptCredentialOnce:i:0