บทนำ
ในบทความก่อนหน้าเราอธิบายการติดตั้ง WSUS Server บน Windows Server 2012 R2 / 2016 แล้ว หลัง Config Update Server แล้ว ต้อง Config Windows Clients (Servers และ Workstations) ให้ใช้ WSUS Server เพื่อรับ Updates ดังนั้น Windows Clients ทั้งหมดใน Network จะได้รับ Updates จาก Internal Update Server ไใช่ Microsoft Update Servers ผ่าน Internet บทความนี้ดูวิธี Config Clients ให้ใช้ WSUS Server ผ่าน Active Directory Domain Group Policies (GPO)
AD Group Policies ช่วยให้ Admin กำหนด Computers ให้เข้า WSUS Groups ต่างๆ อัตโนมัติ WSUS Admin จึงไม่ต้อง Move Computers ระหว่าง Groups ใน WSUS Console เอง และรักษา Groups ให้ Up-to-date การ Assign Clients เข้า Target WSUS Groups 基于 Registry Label บน Client (Labels ตั้งโดย GPO หรือ Registry Modification โดยตรง) เรียกว่า Client-side Targeting
คาดว่า Network จะใช้ 2 Update Policies แยกกัน: แยก Policy สำหรับ Servers และ Workstations สร้าง 2 Groups นี้ใน WSUS Console ใน Section All Computers
Tip: Policy การใช้ WSUS Server โดย Clients ขึ้นมากกับ Organizational Structure ของ AD OUs และ Update Installation Rules ในบริษัท บทความนี้พยายามเข้าใจ Basic Principles ของการใช้ GPO ติดตั้ง Windows Updates
การตั้งค่า Grouping Rule ใน WSUS Console
โดย Default Computers ใน WSUS Console แจกแจง Groups ด้วย Manual โดย Server Admin (Server-side Targeting) ไม่เหมาะกับเรา ตั้งค่าให้ Computers แจกแจง Groups ด้วย Client-side Targeting (ใช้ GPO หรือ Registry Parameters) ใน WSUS Console คลิก Options → Computers เปลี่ยนค่าเป็น “Use Group Policy or registry settings on computers”
การสร้าง GPO สำหรับ WSUS Clients
เปิด Group Policy Management (GPMC.msc) สร้าง 2 GPOs ใหม่: ServerWSUSPolicy และ WorkstationWSUSPolicy
WSUS Group Policy สำหรับ Windows Servers
เริ่มจาก Server Policy – ServerWSUSPolicy
GPO Settings ที่ควบคุม Windows Update Service อยู่ที่: Computer Configuration → Policies → Administrative Templates → Windows Component → Windows Update
ใน Environment นี้ ใช้ Policy นี้สำหรับ Install Updates จาก WSUS บน Windows Servers Computers ที่อยู่ใต้ Policy นี้ Assign เข้า Servers Group ใน WSUS Console นอกจากนี้ ต้องการ Disable Automatic Updates Installation บน Servers เมื่อรับ Updates แล้ว Client ควร Download Updates ที่มีอยู่ไป Local Drive แสดง Notification ใน System Tray และรอ Admin เริ่ม Install เอง (Local หรือ Remote ด้วย PSWindowsUpdate Module) หมายความว่า Production Servers จะไม่ Auto-install Updates และ Restart โดยไม่มีการยืนยันจาก Admin (ปกติ Tasks นี้ทำโดย System Admin ใน Monthly Scheduled Maintenance) ตั้ง Policies ดังนี้:
- Configure Automatic Updates: Enable. 3 – Auto download and notify for install – Client Auto Download Updates ใหม่และ Notify
- Specify Intranet Microsoft update service location: Enable. Set the intranet update service for detecting updates: https://hq-wsus.woshub.com:8530, Set the intranet statistics server: https://hq-wsus.woshub.com:8530 – ตั้ง Address ของ Local WSUS Server และ Statistics Server (ปกติเป็น Server เดียวกัน)
- No auto-restart with logged on users for scheduled automatic updates installations: Enable – Disable Auto-restart หาก User Session เปิดอยู่
- Enable client-side targeting: Enable. Target group name for this computer: Servers – ใน WSUS Console Assign Clients เข้า Servers Group
หมายเหตุ: ตั้งค่า Update Policy ควรศึกษา Settings ทั้งหมดที่มีในแต่ละ Option ของ Windows Update GPO Section และตั้ง Parameters ที่เหมาะกับ Infrastructure และ Organization
WSUS Group Policy สำหรับ Windows Workstations
สมมติต่างจาก Server Policy Updates บน Client Workstations ติดตั้ง Auto ตอนกลางคืนทันทีหลังรับ Updates Computers ควร Restart Auto หลัง Install (Notify User 5 นาทีล่วงหน้า)
ใน GPO นี้ (WorkstationWSUSPolicy) ตั้งค่า:
- Allow Automatic Updates immediate installation: Disabled – Disable Immediate Installation หลังรับ Updates
- Allow non-administrators to receive update notifications: Enabled – แสดง Notifications ให้ Non-Admins และอนุญาต Install Manual
- Configure Automatic Updates: Enabled. Configure automatic updating: 4 – Auto download and schedule the install. Scheduled install day: 0 – Every day. Scheduled install time: 05:00 – Client Download Updates ใหม่และวางแผน Install Auto เวลา 05:00 น.
- Target group name for this computer: Workstations – ใน WSUS Console Assign Client เข้า Workstations Group
- No auto-restart with logged on users for scheduled automatic updates installations: Disabled
- Specify Intranet Microsoft update service location: Enable. Set the intranet update service for detecting updates: https://hq-wsus.woshub.com:8530, Set the intranet statistics server: https://hq-wsus.woshub.com:8530 – Address ของ Corporate WSUS Server
หมายเหตุ: ใน Windows 10 1607 ขึ้นไป ถึงแม้จะระบุรับ Updates จาก Internal WSUS แล้ว Windows 10 อาจยังพยายาม Access Windows Update Servers บน Internet อยู่ ฟีเจอร์นี้เรียกว่า Dual Scan เพื่อปิดการรับ Updates จาก Internet ต้อง Enable Policy เพิ่ม: Do not allow update deferral policies to cause scans against Windows Update
Tip: ให้ Computers ในบริษัทมี Patches ครบ ตั้งค่าให้ Update Service (wuauserv) Force Start บน Client ใน Computer Configuration → Policies → Windows Settings → Security Settings → System Services หา Windows Update ตั้งเป็น Automatic
การ Assign WSUS Group Policies ให้ AD OUs
ขั้นตอนต่อไป Assign Policies ที่สร้างให้ AD Containers (OUs) ที่ตรงกัน ในตัวอย่าง OU Structure เรียบง่าย: 2 Containers – Servers (มี Servers ทั้งหมดยกเว้น Domain Controllers) และ WKS (Workstations – User Computers)
Tip: พิจารณาแค่ Simple Way ของการ Bind WSUS Policies ใน Real World อาจ Link Single WSUS Policy ให้ Domain Computers ทั้งหมด (GPO Assigned to Domain Root) แจกแจง Client Types ต่างๆ ไป OUs ต่างๆ (เหมือนตัวอย่าง สร้าง WSUS Policies แยก Servers และ Workstations) ใน Large Distributed Domains ควร Link WSUS Servers ต่างๆ ไป AD Sites หรือ Assign GPO Based on WMI Filters หรือ Combine Methods
Assign Policy ให้ OU: คลิก OU ที่ถูกต้องใน GPMC → Link an Existing GPO → Check Policy ที่เหมาะสม
Tip: อย่าลืม OU แยก – Domain Controllers ในกรส่วนใหญ่ WSUS Server Policy ควร Link ไป Container นี้ Assign WorkstationWSUSPolicy ให้ AD Container ชื่อ WKS (ที่มี Windows Workstations) แบบเดียวกันUpdate Group Policies บน Clients เพื่อ Bind Client กับ WSUS Server:
gpupdate /forceWindows Update Settings ทั้งหมดที่ตั้งผ่าน GPO ควรปรากฏใน Registry Key HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate
Reg File ต่อไปนี้ใช้ Transfer WSUS Settings ไป Computers อื่นที่ไม่สามารถ Config Update Settings ด้วย GPO ได้ (Computers ใน Workgroup, Isolated Segments, DMZ, etc.)
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate] "WUServer"="https://hq-wsus.woshub.com:8530" "WUStatusServer"="https://hq-wsus.woshub.com:8530" "UpdateServiceUrlAlternate"="" "TargetGroupEnabled"=dword:00000001 "TargetGroup"="Servers" "ElevateNonAdmins"=dword:00000000 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU] "NoAutoUpdate"=dword:00000000 "AUOptions"=dword:00000003 "ScheduledInstallDay"=dword:00000000 "ScheduledInstallTime"=dword:00000003 "ScheduledInstallEveryWeek"=dword:00000001 "UseWUServer"=dword:00000001 "NoAutoRebootWithLoggedOnUsers"=dword:00000001สะดวกควบคุม Applied WSUS Settings บน Clients ด้วย rsop.msc Snap-in
หมายเหตุ: หาก Updates ไม่อยู่บน Client แนะนำตรวจสอบ Windows Update Service Log (C:\Windows\WindowsUpdate.log) อย่างละเอียด โปรดทราบ Windows 10 (Windows Server 2016) ใช้ Format WindowsUpdate.log ต่างจากรุ่นก่อนClient Download Updates ไป Local Folder C:\Windows\SoftwareDistribution\Download
Force ค้นหา Updates ใหม่บน WSUS Server ทันที:
wuauclt /detectnowบางครั้งต้อง Force Client Re-register บน WSUS Server:
wuauclt /detectnow /resetAuthorizationกรณียากลำบาก ลอง Fix wuauserv Service หาก Error 0x80244010 เกิดขึ้น ตั้งค่า Frequency ของการ Check Updates บน WSUS Server ด้วย Policy Automatic Update detection frequency เป็น 3-4 ชั่วโมง
ในบทความต่อไปจะอธิบายรายละเอียด Update Approval บน WSUS Server และวิธี Transfer Approved Updates ระหว่าง Groups บน WSUS Server ด้วย PowerShell