如何防止Windows中的安全策略强制屏幕锁定

We are all believe security. But sometimes security become a bottleneck for our productivity. Enterprises generally put automatic screen lock after idle time for windows operating systems by using security policy.

我们都相信安全。 但是有时安全性成为我们生产力的瓶颈。 企业通常使用安全策略在Windows操作系统空闲时间后设置自动屏幕锁定。

I think this is very good enforcement because I see a lot of workers do not mind this type of security measures. But when using windows in VM it become a bottleneck entering password for a lot of times. Here is a script based solution. Save this script as idle.vbs and then double click it or more convenient start it with task manager for start at startup automatically.

我认为这是非常好的执法,因为我看到很多工人不介意此类安全措施。 但是,在VM中使用Windows时,多次输入密码成为瓶颈。 这是基于脚本的解决方案。 将此脚本另存为idle.vbs ,然后双击它或更方便的使用任务管理器启动它,以便在启动时自动启动。

idle.vbs脚本 (idle.vbs Script)

Following script is developed in Visual Basic scripting language which can be run most of the Windows operating systems like Windows XP, Windows 7, Windows 8, Windows 10, Windows Server 2008, Windows Server 2012, Windows Server 2016 . We will use CreateObject function which will used to send some trivial key strokes to the operating system. This will prevent system to lock the screen. The sending key interval will be set as 6000 milisecond which is fair. We will use Sleep function in order to prevent the script run for ever in a brute force mode.

以下脚本是使用Visual Basic脚本语言开发的,可以在大多数Windows操作系统(如Windows XP,Windows 7,Windows 8,Windows 10,Windows Server 2008,Windows Server 2012,Windows Server 2016)上运行。 我们将使用CreateObject函数,该函数用于将一些简单的按键发送到操作系统。 这将防止系统锁定屏幕。 发送密钥间隔将设置为6000毫秒,这是公平的。 我们将使用Sleep功能,以防止脚本在暴力模式下永远运行。

Dim objResult

Set objShell = WScript.CreateObject("WScript.Shell") 
i = 0

Do While i = 0
 objResult = objShell.sendkeys("{NUMLOCK}{NUMLOCK}")
 Wscript.Sleep (6000)
Loop

6000 means 6 seconds the script sends NUMLOCK to prevent screen lock. We can change it according our policy interval.

6000表示脚本在6秒钟内发送了NUMLOCK以防止屏幕锁定。 我们可以根据我们的政策间隔进行更改。

LEARN MORE  Linux Netstat Command With Examples
了解更多带有示例Linux Netstat命令

翻译自: https://www.poftut.com/how-to-prevent-security-policy-enforced-screen-lock-in-windows/

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值