简体   繁体   English

检查Windows内置本地来宾帐户是否已打开

[英]Check if Windows built-in local guest account is turned on

I'm trying to do a check that will determine if the local Windows guest account is turned on or off. 我正在尝试进行一项检查,以确定本地Windows来宾帐户是打开还是关闭。 (Please note this is different from enabled/disabled, which I can currently do a check for). (请注意,这与启用/禁用不同,我目前可以对其进行检查)。

As far as I can tell the only place the the on/off setting has any impact is in the Local Security Policy setting "Deny log on locally". 据我所知,on / off设置唯一有影响的地方是本地安全策略设置“拒绝本地登录”。

An acceptable workaround would be any check that can determine if the built-in guest account is capable of being displayed during the log-in screen. 可接受的解决方法是可以确定内置访客帐户是否能够在登录屏幕期间显示的任何检查。 That question is really the only thing my method needs to know. 这个问题实际上是我的方法需要知道的唯一一件事。 Thanks in advance. 提前致谢。

Edit for clarification: 编辑以澄清:

在此处输入图片说明

This question was answered by AverageJoeOfToronto over at Technet : 在Technet上AverageJoeOfToronto回答了这个问题:

Since I'm really only trying to determine the status of this setting (as opposed to editing it), the solution provided was to export the security policy using secedit. 由于我实际上只是在尝试确定此设置的状态(而不是对其进行编辑),因此提供的解决方案是使用secedit导出安全策略。

secedit.exe /export /cfg %temp%\UserRights.inf /areas User_Rights /log %temp%\UserRights.log

Produces a CFG which will contain a line with the relevant "Deny log on locally" list: 生成一个CFG,其中将包含带有相关的“本地拒绝登录”列表的行:

SeDenyInteractiveLogonRight = Guest

For a lot of domain computers this will probably include ASPNET as well (I recall seeing people looking for the same solution specifically to filter out ASPNET). 对于许多域计算机来说,它可能也将包括ASPNET(我记得有人在寻找专门用于过滤ASPNET的相同解决方案)。 When ASPNET or other accounts are present the output is comma separated 存在ASPNET或其他帐户时,输出以逗号分隔

SeDenyInteractiveLogonRight = ASPNET,Guest,AnotherUser

AverageJoe was even kind enough to inform me that this policy can be edited with NTrights.exe available in the Windows Resource Toolkit. AverageJoe甚至足够友好地通知我,可以使用Windows资源工具包中的NTrights.exe来编辑此策略。

If you get any use from this post, please go over and up vote his answer at Technet as he apparently spent over an hour looking for this solution. 如果您对此帖子有任何用处,请继续在Technet上投票表决他的答案,因为他显然花了一个多小时来寻找此解决方案。 Thanks Joe. 谢谢乔。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM