标题: [系统增强] 批处理修改组策略限制用户更改系统时间 [打印本页]
作者: fastslz 时间: 2009-6-1 22:35 标题: 批处理修改组策略限制用户更改系统时间
-
- :::: 限制用户更改系统时间 By FastSLZ 2009-6-1 CMD WinXP SP2 or WinXP SP3
- @echo off&SetLocal EnableDelayedExpansion
- set "SecPath=%WINDIR%\security\Database"
- cd.>"%SecPath%\sec.cfg"
- if not exist "%SecPath%\sec.bak" secedit /export /cfg "%SecPath%\sec.bak" /quiet
- for /f "delims=" %%i in ('type "%SecPath%\sec.bak"') do (
- set "var=%%i"
- if "!var:~0,21!"=="SeSystemtimePrivilege" (>>"%SecPath%\sec.cfg" echo SeSystemtimePrivilege =) else >>"%SecPath%\sec.cfg" echo/!var!
- )
- secedit /configure /db "%SecPath%\sec.sdb" /cfg "%SecPath%\sec.cfg" /quiet
- gpupdate /force >nul
- echo 重启生效!&pause>nul
复制代码
其它本地安全策略可以参考此代码-
- @echo off
- ::::还原系统时间可更改状态
- secedit /configure /db "%SecPath%\sec.sdb" /cfg "%SecPath%\sec.bak" /quiet
- gpupdate /force >nul
- echo 重启生效!&pause>nul
复制代码
欢迎光临 批处理之家 (http://bathome.net./) |
Powered by Discuz! 7.2 |