我需要编写一个脚本,在Local Computer Policy > Computer Configuration > Windows Settings > Security Settings > User Rights Assignment > Change the system time所有Windows XP计算机上的本地组策略(gpedit.msc)中Local Computer Policy > Computer Configuration > Windows Settings > Security Settings > User Rights Assignment > Change the system time 。 这些机器不在域上。 我有办法自动分发和运行脚本。 有人能指出我正确的方向来创build一个这样的脚本吗?
那么,忽略一个pipe理员可以改回它的事实..;)
secedit工具应该提供您需要的function。 使用/areas SECURITYPOLICY 。
迟到的答案,但可能是有用的。 您也可以尝试使用Windows Server 2003资源工具包工具 ntrights.exe中的实用程序来执行此操作。
示例脚本(在Windows XP Professional SP3上testing) :
@echo off echo Start process %date% %time% >> %~dp0%~n0.log cd /d "c:\work" rem Revokes "Change system time" right from Administrators ntrights.exe -r SeSystemtimePrivilege -u "Administrators" >> %~dp0%~n0.log rem Revokes "Change system time" right from Power users ntrights.exe -r SeSystemtimePrivilege -u "Power Users" >> %~dp0%~n0.log rem Revokes "Change system time" right from user2 ntrights.exe -r SeSystemtimePrivilege -u "user2" >> %~dp0%~n0.log rem Grant "Change system time" right to user1 ntrights.exe +r SeSystemtimePrivilege -u "user1" >> %~dp0%~n0.log echo End process %date% %time% >> %~dp0%~n0.log rem Reboot if you need shutdown /r /t 10