Board logo

标题: [系统增强] 批处理修改组策略限制用户更改系统时间 [打印本页]

作者: fastslz    时间: 2009-6-1 22:35     标题: 批处理修改组策略限制用户更改系统时间

  1. :::: 限制用户更改系统时间 By FastSLZ 2009-6-1 CMD WinXP SP2 or WinXP SP3
  2. @echo off&SetLocal EnableDelayedExpansion
  3. set "SecPath=%WINDIR%\security\Database"
  4. cd.>"%SecPath%\sec.cfg"
  5. if not exist "%SecPath%\sec.bak" secedit /export /cfg "%SecPath%\sec.bak" /quiet
  6. for /f "delims=" %%i in ('type "%SecPath%\sec.bak"') do (
  7. set "var=%%i"
  8. if "!var:~0,21!"=="SeSystemtimePrivilege" (>>"%SecPath%\sec.cfg" echo SeSystemtimePrivilege =) else >>"%SecPath%\sec.cfg" echo/!var!
  9. )
  10. secedit /configure /db "%SecPath%\sec.sdb" /cfg "%SecPath%\sec.cfg" /quiet
  11. gpupdate /force >nul
  12. echo 重启生效!&pause>nul
复制代码
其它本地安全策略可以参考此代码
  1. @echo off
  2. ::::还原系统时间可更改状态
  3. secedit /configure /db "%SecPath%\sec.sdb" /cfg "%SecPath%\sec.bak" /quiet
  4. gpupdate /force >nul
  5. echo 重启生效!&pause>nul
复制代码





欢迎光临 批处理之家 (http://bathome.net./) Powered by Discuz! 7.2