Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การแก้ไขปัญหา >> การบำรุงรักษาคอมพิวเตอร์

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้ 'System Notification Service' Delay

คู่มือนี้ประกอบด้วยคำแนะนำทีละขั้นตอนในการแก้ไขปัญหาต่อไปนี้: เมื่อผู้ใช้พยายามล็อกออฟจาก Windows RDS Server 2016 การล็อกออฟค้างที่ "please wait for the system event notification service" ผลสืบเนื่องจากปัญหา เซสชัน RDP ไม่เคยปิด และผู้ใช้ไม่สามารถล็อกออฟหรือเชื่อมต่อกลับไปที่ RDS server ได้

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

รายละเอียดปัญหา: ผู้ใช้ Remote Desktop ไม่สามารถตัดการเชื่อมต่อจาก RDSH Server 2012/2016/2019 ได้ และได้รับข้อความ "Wait for the system notification service" และไม่สามารถเชื่อมต่อใหม่ได้ เมื่อปัญหาเกิดขึ้น สถานะเซสชันบน RDS Server คือ "Disconnected" และไม่สามารถล็อกออฟเซสชันที่ตัดการเชื่อมต่อแล้วจากเซิร์ฟเวอร์ได้

รายการข้อผิดพลาดบน RDS Server เมื่อปัญหาเกิดขึ้น:

  • Event ID 4627: The COM+ Event System timed out attempting to fire the Logon method on event class {D5978650-5B9F-11D1-8DD2-00AA004ABD5E} for publisher and subscriber . The subscriber failed to respond within 180 seconds. The display name of the subscription is "HB_System_Logon". The HRESULT was 800705b4.
  • Event ID 4627: The COM+ Event System timed out attempting to fire the Logoff method on event class {D5978650-5B9F-11D1-8DD2-00AA004ABD5E} for publisher and subscriber . The subscriber failed to respond within 180 seconds. The display name of the subscription is "HB_System_Logoff". The HRESULT was 800705b4.
  • Even ID 6001: The winlogon notification subscriber <Sens> failed a notification event.
  • Event ID 6005: The winlogon notification subscriber <Sens> is taking long time to handle the notification event (Logoff)."

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

วิธีแก้ไข: RDP Users Cannot Logoff และ Unable to Log Off Disconnected session ใน Windows Server 2016/2019

วิธีที่ 1: รีสตาร์ท Print Spooler

วิธีที่ 2: บังคับ Sign Out ผู้ใช้ Remote Desktop

วิธีที่ 3: ถอนการติดตั้งโปรแกรม Antivirus

วิธีที่ 4: ค้นหาสาเหตุที่ทำให้ SENS service ค้าง

วิธีที่ 5: สั่งให้ Windows ยุติโปรแกรมหรือบริการที่ไม่ตอบสนองอัตโนมัติ

วิธีที่ 1: รีสตาร์ท Print Spooler

วิธีแรกในการแก้ไขปัญหา "Please wait for the System Notification Service" คือการรีสตาร์ทบริการ Print Spooler บน RDS server 2016 ดำเนินการดังนี้:

1. กดปุ่ม Windows แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay + R พร้อมกันเพื่อเปิดกล่องคำสั่ง Run
2. ในกล่องคำสั่ง Run พิมพ์: services.msc และกด Enter

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

3. คลิกขวาที่บริการ Print Spooler และคลิก Restart

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

4. หลังจากรีสตาร์ท Print Spooler ลองเชื่อมต่อกลับไปที่ RDP Server และตรวจสอบว่าปัญหายังคงอยู่หรือไม่

วิธีที่ 2: บังคับ Sign Out ผู้ใช้ Remote Desktop

หากคุณไม่สามารถล็อกออฟเซสชันที่ตัดการเชื่อมต่อจาก RDS Server ได้อย่างปกติ (โดยใช้คลิกขวา -> "Sign out user") ให้ลองปิดเซสชัน RDP โดยบังคับด้วยการ kill กระบวนการ "Winlogon" ของเซสชันนั้น ดำเนินการดังนี้:

1. บน RDP Server 2016 กด Ctrl + Alt + Delete เพื่อเปิด Task Manager
2. ที่แท็บ Users 'ขยาย' ผู้ใช้ที่มีสถานะ "Disconnected"

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

3. คลิกขวาที่ Windows Logon Application และคลิก Go to details

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

4. สังเกต PID ของกระบวนการ winlogon.exe ที่ไฮไลท์ (เช่น "6116" ในตัวอย่างนี้)

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

5. เปิด PowerShell as Administrator
6. ใน PowerShell พิมพ์คำสั่งต่อไปนี้และกด Enter *

  • kill -id PID

* หมายเหตุ: PID = PID ที่คุณสังเกตในขั้นตอนก่อนหน้า

ตัวอย่าง ในตัวอย่างนี้คำสั่งจะเป็น: kill -id 6116

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

7. เมื่อถูกถามว่าต้องการดำเนินการ Stop-Process หรือไม่ กดปุ่ม y *

* หมายเหตุ: หากหลังจากกด "y" ได้ข้อผิดพลาด "Unable to terminate process. The operation could not be completed, Access is denied" วิธีเดียวที่จะหยุดเซสชัน RDP คือการ hard reboot เซิร์ฟเวอร์ RDP

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

8. ปิดและเปิด Task Manager ใหม่ เพื่อให้แน่ใจว่าการเชื่อมต่อปิดแล้ว
9. ทำขั้นตอนเดียวกัน และ kill กระบวนการ "Winlogon.exe" สำหรับผู้ใช้ "Disconnected" คนอื่นๆ
10. เมื่อเสร็จแล้ว ลองเชื่อมต่อและตัดการเชื่อมต่อไปที่ RDS Server 2-3 ครั้ง เพื่อให้แน่ใจว่าปัญหาแก้ไขแล้ว หากปัญหายังคงอยู่ ให้ดำเนินการต่อไปวิธีที่ 3 *

* ข้อเสนอแนะ: เผื่อกรณี รีสตาร์ท เซิร์ฟเวอร์ RDS เนื่องจากผมสังเกตว่าปัญหาบางครั้งเกิดหลังจากติดตั้งอัปเดตโดยไม่รีสตาร์ทเครื่อง

วิธีที่ 3: ถอนการติดตั้งโปรแกรม Antivirus

อีกสาเหตุหนึ่งของข้อความข้อผิดพลาด "Please wait for the System Notification Service" คือโปรแกรมแอนตี้ไวรัสที่ติดตั้งบน RDS Server โดยเฉพาะอย่างยิ่ง ปัญหาอาจเกิดจากโปรแกรมแอนตี้ไวรัสใดๆ (ESET, Symantec, McAfee ฯลฯ) ดังนั้นแนะนำให้รันเซิร์ฟเวอร์โดยไม่มีแอนตี้ไวรัสเป็นสองสามวัน เพื่อตรวจสอบว่ามันเป็นสาเหตุหรือไม่ *

* หมายเหตุ:
1. ผมรู้ว่าไม่ใช่โซลูชันที่เหมาะสม แต่คุณสามารถเปิดใช้งาน Windows Defender Antivirus เพื่อการป้องกัน
2. หากปัญหายังคงอยู่ ให้ดำเนินการต่อไปวิธีถัดไป

วิธีที่ 4: ค้นหาสาเหตุที่ทำให้ SENS service ค้าง

ขั้นตอนที่ 1: ตรวจสอบ Event Errors ใน Event Viewer

1. ไปที่ Event Viewer -> Windows logs -> Application
2. ตรวจสอบ Events ทั้งหมดที่มี ID 4627 เพื่อดูว่าสามารถหาชื่อโปรแกรมที่เป็นสาเหตุจาก display name ของ subscription ได้หรือไม่ *

* หมายเหตุ: หากชื่อ subscription คือ "HB_System_Logoff", "HB_System_Logon", "HB_DisplayLock" หรือ "HB_DisplayUnlock" ให้ดำเนินการต่อไปขั้นตอนถัดไป เนื่องจาก subscription ทั้งหมดนี้เป็นฟังก์ชันของบริการ "System Event Notification" ดังนั้นข้อมูลจึงไม่มีประโยชน์

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

ขั้นตอนที่ 2: ตรวจสอบประวัติปัญหาในแผงควบคุม Security and Maintenance

1. ไปที่ Control Panel และเปิด 'Security and maintenance' *

* หมายเหตุ: หากคุณไม่เห็นเมนู 'Security and maintenance' ให้ตั้ง View by เป็น All Items

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

2. ขยายตัวเลือก Maintenance และเลือก View reliability history

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

3. ที่หน้าจอ Reliability and Problem history:

ก. บนหน้าต่างด้านบน เลือกวันที่ที่ปัญหาเกิดขึ้น
ข. ที่หน้าต่างด้านล่าง คลิกขวาที่โปรแกรมหรือบริการที่ล้มเหลว และเลือก View technical details

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

4. ในรายงานโดยละเอียด ให้สังเกตว่าแอปพลิเคชัน (หรือบริการ) ไหนก่อให้ระบบค้าง *

* เคล็ดลับ: หากคุณไม่รู้จักแอปพลิเคชัน ให้ค้นหาใน Google เพื่อหาว่ามันเป็นซอฟต์แวร์ของบริษัทไหน

ตัวอย่าง ที่นี่ แอปพลิเคชัน "ekrn.exe" ทำให้ Windows Explorer ค้าง (ekrn.exe เป็นกระบวนการจากซอฟต์แวร์ ESET antivirus ที่ทำงานบนระบบ)

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

วิธีที่ 5: สั่งให้ Windows ยุติโปรแกรมหรือบริการที่ไม่ตอบสนองอัตโนมัติ

ข้อผิดพลาด "Please wait for the SENS service" เป็นปัญหาเก่าและอาจปรากฏแบบสุ่มโดยไม่มีสาเหตุชัดเจนในทุกเวอร์ชันเซิร์ฟเวอร์ (Windows Server 2012, 2016 หรือ 2019) ดังนั้น อีกวิธีที่เป็นไปได้ในการแก้ไขปัญหาคือ สั่งให้ Windows ยุติโปรแกรมและบริการที่ไม่ตอบสนองเมื่อ restart, shutdown หรือ sign out ดำเนินการดังนี้:

1. บน RDS Server เปิด registry editor และไปที่คีย์ต่อไปนี้ในหน้าต่างด้านซ้าย:

  • HKEY_USERS\.DEFAULT\Control Panel\Desktop

2. คลิกขวาที่พื้นที่ว่าง (ด้านขวา) และเลือก New > String Value

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

3. ตั้งชื่อค่าใหม่ว่า AutoEndTasks และกด Enter

4. ดับเบิลคลิก ที่ AutoEndTasks (REG_SZ) และที่ฟิลด์ Value Data พิมพ์ 1 & กด OK

แก้ไข RDS Logoff Hang บน Windows Server 2016/2019: แก้  System Notification Service  Delay

5. ปิด registry editor & รีสตาร์ท เซิร์ฟเวอร์

เสร็จสิ้น! วิธีไหนทำงานได้กับคุณ?
แจ้งให้เราทราบว่าคู่มือนี้ช่วยคุณได้หรือไม่โดยการแสดงความคิดเห็นเกี่ยวกับประสบการณ์ของคุณ โปรดกดไลค์และแชร์คู่มือนี้เพื่อช่วยผู้อื่น