|
我也献丑一下:- set_synctime.bat
- @echo off
- sc config w32time start= auto
- sc start w32time
- ::为本地登陆用户授权可修改时间(主要给工作站加AD域后的受限用户修改时间权限等)
- ntrights.exe -u INTERACTIVE +r SeSystemtimePrivilege
- ntrights.exe -u INTERACTIVE +r SeRemoteShutdownPrivilege
- ntrights.exe -u INTERACTIVE +r SeShutdownPrivilege
- ::创建计划任务,为服务器创建和外步时间服务器同步
- ::schtasks /create /ru "NT AUTHORITY\SYSTEM" /tn synctime2 /tr %windir%\tool\synctime\synctime_workgroup.bat /sc onstart
- ::schtasks /create /ru "NT AUTHORITY\SYSTEM" /tn synctime1 /tr %windir%\tool\synctime\synctime_workgroup.bat /sc onlogon
- schtasks /create /ru "NT AUTHORITY\SYSTEM" /tn synctime0 /tr %windir%\tool\synctime\synctime_workgroup.bat /sc weekly /D THU /ST 09:30 /F
复制代码
- synctime_workgroup.bat
- @echo off
- w32tm /config /manualpeerlist:"time.pool.aliyun.com" /syncfromflags:manual /reliable:yes /update
- w32tm /resync
复制代码 两个文件,第一个是用来设置权限及计划任务的(有第三方工具:ntrights.exe),第二个是执行同步的
|
|