Thông tin liên hệ
- 036.686.3943
- admin@nguoicodonvn2008.info
Nếu máy tính là một Active Directory Domain Controller, tính năng NTP Server đã được kích hoạt tự động. Vì vậy, ví dụ sau dành cho máy tính cần kích hoạt tính năng NTP Server trong môi trường WorkGroup.
1. Chạy PowerShell với quyền admin và cấu hình như sau:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# confirm current setting (follows are default settings)
PS C:\Users\Administrator> Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\w32time\TimeProviders\NtpServer"
InputProvider : 0
AllowNonstandardModeCombinations : 1
EventLogFlags : 0
ChainEntryTimeout : 16
ChainMaxEntries : 128
ChainMaxHostEntries : 4
ChainDisable : 0
ChainLoggingRate : 30
RequireSecureTimeSyncRequests : 0
DllName : C:\Windows\SYSTEM32\w32time.DLL
Enabled : 0
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Serv
ices\w32time\TimeProviders\NtpServer
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Serv
ices\w32time\TimeProviders
PSChildName : NtpServer
PSDrive : HKLM
PSProvider : Microsoft.PowerShell.Core\Registry
# enable NTP Server feature
PS C:\Users\Administrator> Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\w32time\TimeProviders\NtpServer" -Name "Enabled" -Value 1
# set [AnnounceFlags] to 5
# number means
# 0x00 : Not a time server
# 0x01 : Always time server
# 0x02 : Automatic time server
# 0x04 : Always reliable time server
# 0x08 : Automatic reliable time server
PS C:\Users\Administrator> Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\services\W32Time\Config" -Name "AnnounceFlags" -Value 5
# restart Windows Time service
PS C:\Users\Administrator> Restart-Service w32Time
# if Windows Firewall is running, allow NTP port
PS C:\Users\Administrator> New-NetFirewallRule `
-Name "NTP Server Port" `
-DisplayName "NTP Server Port" `
-Description 'Allow NTP Server Port' `
-Profile Any `
-Direction Inbound `
-Action Allow `
-Protocol UDP `
-Program Any `
-LocalAddress Any `
-LocalPort 123
2. NTP Server Host cũng cần đồng bộ hóa thời gian với các Host khác với tư cách là NTP Client.
Cài đặt NTP Client được cấu hình với NTP Server [time.windows.com] theo mặc định của Windows, vì vậy nếu máy tính kết nối với Internet, ngày và giờ sẽ được đồng bộ.
Hơn nữa, nếu máy tính ở trong Active Directory Domain, cài đặt NTP Client cũng được cấu hình như sau, vì vậy nói chung không cần phải thay đổi cài đặt:
Trong máy tính môi trường WorkGroup, có thể thay đổi NTP server mặc định thành những máy chủ khác như sau.
1. Chạy PowerShell với quyền admin và cấu hình như sau:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# confirm current synchronization NTP Server
PS C:\Users\Administrator> w32tm /query /source
time.windows.com,0x8
# change target NTP Server (replace to your timezone server)
# number means
# 0x01 : SpecialInterval
# 0x02 : UseAsFallbackOnly
# 0x04 : SymmetricActive
# 0x08 : NTP request in Client mode
PS C:\Users\Administrator> Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\w32time\Parameters" -Name "NtpServer" -Value "ntp.nict.jp,0x8"
# restart Windows Time service
PS C:\Users\Administrator> Restart-Service w32Time
# re-sync manually
PS C:\Users\Administrator> w32tm /resync
Sending resync command to local computer
The command completed successfully.
# verify status
PS C:\Users\Administrator> w32tm /query /status
Leap Indicator: 0(no warning)
Stratum: 4 (secondary reference - syncd by (S)NTP)
Precision: -23 (119.209ns per tick)
Root Delay: 0.0252246s
Root Dispersion: 0.0824040s
ReferenceId: 0x85F3EEF3 (source IP: 133.243.238.243)
Last Successful Sync Time: 9/23/2019 10:15:33 PM
Source: ntp.nict.jp,0x8
Poll Interval: 8 (256s)
2. Nếu một máy tính ở trong môi trường domain Active Directory và là một Forest Root, thì mục tiêu đồng bộ thường được cấu hình thành [Local CMOS Clock] (Hardware Clock). Sau đó, nếu bạn muốn thay đổi cài đặt từ [Local CMOS Clock] sang NTP server mạng, hãy thiết lập như sau:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# in AD Domain Environment, [Type] is set to [NT5DS]
PS C:\Users\Administrator> (Get-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Services\w32time\Parameters").GetValue("Type")
NT5DS
# if target is [Local CMOS Clock] but you'd like to change it, change [Type] to [NTP] first
# next, change to NTP server with the same way in [1] section
PS C:\Users\Administrator> Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\w32time\Parameters" -Name "Type" -Value "NTP"
Nguồn tin: Quantrimang.com
Ý kiến bạn đọc
Những tin mới hơn
Những tin cũ hơn
Quản lý tài liệu trong kho kiến thức ElevenAgents
Generative Orchestration trong Copilot Studio: Cách agent đưa ra quyết định
Cách chỉnh sửa và nâng cấp câu hỏi bằng Wayground AI
Cách kết nối Claude với Gamma tạo website, slide thuyết trình
Hướng dẫn lọc và xóa thư với Plugin Gmail trong ChatGPT
11 trang web xem phim miễn phí vẫn hoạt động vào năm 2026
Hướng dẫn dùng Wayground AI để tạo bài kiểm tra
Hướng dẫn sử dụng Claude Slides tạo bài thuyết trình
Cách dùng plugin Wayground với ChatGPT
Ký tự khoảng trống FF là gì? Cách tạo tên trống trong Free Fire
Nâng cao khả năng ElevenAgents bằng cơ sở kiến thức quy mô lớn sử dụng RAG
100 ChatGPT/Gemini code giúp bạn chỉnh sửa ảnh như một chuyên gia
Cách thêm nhiều tài khoản Gmail vào plugin Gmail trên ChatGPT
Claude Design là gì? Cách dùng Claude Design thiết kế giao diện web
Làm sao để không còn nhận được những câu trả lời chung chung khi nhập prompt vào Claude nữa?
Hướng dẫn quản lý và ngắt kết nối ứng dụng trên ChatGPT
Hướng dẫn thiết lập thông báo giờ nghỉ trên Claude
Cách viết chữ kiểu FB: chữ in đậm, chữ 𝒏𝒈𝒉𝒊𝒆̂𝒏𝒈, đổi font chữ Facebook
Agent hỗ trợ nhiều giọng nói trong ElevenAgents
Kết hợp các kỹ thuật tạo prompt để thực hiện dự án thực tế
Hướng dẫn cài đặt và sử dụng n8n trên Windows 11
Cách lập trình chuyên nghiệp hơn, dễ dàng hơn với tính năng Tệp trên Grok
Công thức tính diện tích hình Elip
Hướng dẫn ngắt kết nối ứng dụng trên ChatGPT
Hướng dẫn tạo đoạn hội thoại cho topic trên Twee
Bức tranh tổng quan về hỗ trợ khách hàng tích hợp AI
Đừng chia sẻ ảnh cho đến khi bạn chạy kiểm tra siêu dữ liệu này!
6 cách mở Computer/System Properties trong Windows 10
Cách sửa lỗi There Are Currently No Power Options Available Windows
Hướng dẫn 8 cách mở bàn phím ảo trên Windows 10