บทนำ
พบ "Feature" หรือ "Bug" น่าสนใจใน Windows Update Service บน Windows Server 2016 (Windows 10 RTM) หากไม่ใช้ Internal WSUS Server และ OS ต้อง Update ตรงจาก Microsoft Update Servers บน Internet เมื่อ Download Updates ใน Windows Server 2016 ผ่าน Proxy Server กระบวนการ Download ค้างที่ 0% (Downloading Updates 0%)
น่าสนใจคือ Windows Update Client ส่ง/ดาวน์โหลด Updates Metadata ได้สำเร็จ (รายการ Updates ที่จำเป็นถูกสร้างแล้ว) แต่ไม่มี Update ไหนถูก Download จริง
สร้างและเปิด WindowsUpdate.log ด้วย Get-WindowsUpdateLog Cmdlet:
2018/11/11 12:32:47.8312332 123 3542 DownloadManager BITS job initialized...
2018/11/11 12:32:47.8734449 123 3542 DownloadManager Failed to connect to the DO service; (hr = 80040154)
2018/11/11 12:32:47.8734472 123 3542 DownloadManager Failed creating DO job with hr 80246008
2018/11/11 12:32:47.8772521 123 3542 DownloadManager DO download failed with error 80246008[Extended: 80040154], falling back to BITS and retrying with new Download Job.
เห็นว่า BITS ไม่สามารถ Download Files ได้ Error 80246008 (SUS_E_DM_FAILTOCONNECTTOBITS)
สาเหตุและวิธีแก้ไข
Proxy Settings สำหรับ Internet Explorer ใน Windows Server 2016 RTM (10.0.14393) ไม่ทำงานเหมือน Windows รุ่นก่อน เพื่อให้ Windows Update Client เข้าถึง Internet ผ่าน Proxy ต้อง Force Set System Proxy สำหรับ WinHTTP
แสดง Proxy Settings ปัจจุบันสำหรับ WinHTTP:
netsh winhttp show proxy
ผลลัพธ์: Direct access (no proxy server) แสดงว่า WinHTTP Proxy Settings ไม่ได้ตั้งค่า Proxy ถูกตั้งใน IE ระดับ User แต่ไม่ใช่ระดับ System (WinHTTP) ทำให้ Connection ไป Windows Update ล้มเหลว
ตั้งค่า System Proxy Parameters สำหรับ WinHTTP:
netsh winhttp set proxy proxy-server="192.168.100.24:3128" bypass-list="*.woshub.com"
หรือ Import Settings จาก IE (Proxy Settings ใน IE ต้องตั้งค่าเอง หรือ Config ด้วย GPO ก่อน):
netsh winhttp import proxy source=ie
หลังเปลี่ยน Proxy Settings Restart Windows Update Service:
Restart-service wuauserv
หลังระบุ Proxy สำหรับ WinHTTP แล้ว Windows Server 2016 เริ่ม Download Updates จาก Microsoft Update Servers ได้ปกติ
ปัญหาเดียวกันเกิดบน Windows 10 RTM Version (RTM Version ของ Windows Update Agent – 10.0.14393.0)
หมายเหตุ: หาก Download และ Install Latest Cumulative Update จาก Microsoft Update Catalog ด้วยตนเอง (Released หลัง November 2016) Updates จะ Download และ Install ได้ปกติแม้ไม่ตั้ง WinHTTP Proxy ตามข้อมูล Microsoft Bug นี้แก้ไขแล้วใน Windows Update Agent 10.0.14393.187 ขึ้นไป
หมายเหตุเพิ่มเติม: ไม่สามารถรับ Updates ผ่าน Proxy Server ที่ต้อง Authentication ได้ เนื่องจาก Windows Update Client ไม่รองรับ Proxy Authentication (ต่างจาก PowerShell) เพื่อให้ Windows Update ทำงานถูกต้อง ต้อง Allow Anonymous Access ไป Microsoft Update Servers บน Proxy Server รายการ URLs ด้านล่าง:
- *.microsoft.com
- microsoft.com
- *.windowsupdate.com
- windowsupdate.com
- *.trafficmanager.net
- trafficmanager.net