内网Windows时间服务器搭建

2025-10-09 10:04:43

1、下载Windows Server2008系统镜像,可以到百度我告诉你下载,下载安装VMWare,打开BIOS虚拟化开关VT-d。

内网Windows时间服务器搭建

2、本地电脑远程登录服务器,点击底部Win按钮,搜索远程桌面连接连接虚拟机。

内网Windows时间服务器搭建

3、时间服务器配置脚本说明:

1、time_server_config.bat批处理脚本是对服务器进行配置;

批处理脚本运行好以后,运行services.msc,找到Windows time服务,改为自动启动;

关闭防火墙。

2、time_client_config.bat批处理脚本是对客户端电脑进行配置;

自动更新时间设为5分钟。

3、autostart.bat批处理脚本是重启w32time时间服务。

4、start.bat批处理脚本是将autostart.bat启动脚本拷贝至系统启动自动执行目录下,这样开机就能启动w32time时间服务。

执行说明:

1、服务器端就按上面步骤1执行。

2、客户端,①先执行time_client_config.bat脚本

②执行start.bat脚本,autostart.bat脚本不用手动执行(这个脚本是系统启动后自动启动服务的脚本)。

4、time_server_config.bat服务器上运行脚本

@ECHO OFF

REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" /V Type /T REG_SZ /D NTP /F

REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config" /V AnnounceFlags /T REG_DWORD /D 5 /F

REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer" /V Enabled /T REG_DWORD /D 1 /F

net stop w32time

net start w32time

netsh firewall add portopening protocol = UDP port = 123 name = NTPSERVER

EXIT

5、time_client_config.bat客户端上运行脚本

@ECHO OFF

REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient" /V SpecialPollInterval /T REG_DWORD /D 300 /F

net stop w32time

net start w32time

EXIT

6、start.bat批处理脚本

@ECHO OFF

copy "./autostart.bat" "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"

EXIT

7、autostart.bat批处理脚本

@ECHO OFF

net start w32time

EXIT

8、本机电脑设置时间服务器IP。

内网Windows时间服务器搭建

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢