Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบ >> Windows 10

โหมด Remote Desktop Session Shadowing ใน Windows 10

นอกจาก Remote Assistance แล้ว ยังสามารถใช้ Remote Desktop Session Shadowing เชื่อมต่อไปยัง Desktop ของผู้ใช้ Windows 10 ได้ Administrator ส่วนใหญ่ใช้ฟีเจอร์นี้เชื่อมต่อ User Sessions บน RDS Servers ที่รัน Windows Server 2012 R2 / Server 2016 แต่ไม่กี่คนรู้ว่า Session Shadowing สามารถใช้ View และ Manage User Desktop Console Session ใน Windows 10 ได้เช่นกัน มาดูวิธีการทำงาน

เช่นคุณจำได้ หากพยายามเชื่อมต่อคอมพิวเตอร์ Windows 10 ด้วย RDP Session ของผู้ใช้ที่ทำงานอยู่ในเครื่องจะถูกขับออก (แม้จะเปิด Multiple concurrent RDP sessions ใน Windows 10) แต่สามารถเชื่อมต่อ User Console Session โดยตรงโดยไม่ Lock ได้

สมมติ ต้องการเชื่อมต่อจาก Server ที่รัน Windows Server 2012 R2 ไป Desktop ของ User ที่ทำงานอยู่บน Workstation Windows 10 Pro

เพื่อสร้าง Shadow connection ไปยัง User Session ต้องใช้ Tool RDP มาตรฐาน mstsc.exe คำสั่งเป็นแบบนี้:

Mstsc.exe /shadow:<Session ID> /v:<Computer name or IP address>

สามารถใช้ตัวเลือกเพิ่มเติมได้:

  • /prompt — ขอ Credentials ผู้ใช้เพื่อเชื่อมต่อ (ถ้าไม่ระบุ จะเชื่อมต่อด้วย Credentials ผู้ใช้ปัจจุบัน)
  • /control — โหมดที่อนุญาตให้ Interact กับ User Session หากไม่ตั้งค่านี้ จะเชื่อมต่อใน View mode เท่านั้น (ควบคุม Mouse/Keyboard ไม่ได้)
  • /noConsentPrompt — อนุญาตให้ไม่ขอยืนยันจาก User ก่อนเชื่อมต่อ Session

การตั้งค่า Remote Shadowing ทำผ่าน Group Policy หรือแก้ไข Registry สามารถกำหนดว่าต้องขอยืนยันจาก User หรือไม่ และอนุญาต View หรือ Control ใน Shadow session

Policy อยู่ใน GPO Editor: Computer Configuration → Policies → Administrative Templates → Windows Components → Remote Desktop Services → Remote Session Host → Connections ชื่อ Set rules for remote control of Remote Desktop Services user sessions

แทนที่จะ Enable Policy สามารถตั้งค่า DWORD Registry Parameter Shadow ใน Key HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services ค่าที่อนุญาต:

  • 0 — ปิด Remote Control
  • 1 — Full control พร้อมขออนุญาต User
  • 2 — Full control ไม่ขออนุญาต User
  • 3 — View session พร้อมขออนุญาต User
  • 4 — View session ไม่ขออนุญาต User

ค่าเริ่มต้น Registry parameter นี้ไม่ได้ตั้งค่า และ Shadow connection จะทำงานใน Full control mode พร้อมขออนุญาต User

เพื่อเชื่อมต่อ User Session แบบ Remote ด้วย Shadowing บัญชีที่เชื่อมต่อต้องมีสิทธิ์ Administrator และ Remote Desktop (RDP) ต้องเปิดใช้งานบนคอมพิวเตอร์ Windows 10 (ใน System Properties)

ลอง Request รายการ Sessions บน Windows 10 Workstation แบบ Remote ด้วยคำสั่ง:

qwinsta /server:192.168.1.90

จะเห็น Console User Session 1 รายการ ID = 1 บนเครื่องนี้

ลองเชื่อมต่อ Remote ไป User Session 1 ผ่าน Shadow connection รันคำสั่ง:

Mstsc /shadow:1 /v:10.10.11.60

User Windows 10 จะเห็น Request บนหน้าจอ:
Remote connection request
PC\admin is requesting to view your session remotely. Do you accept the request?

หาก User ยอมรับการเชื่อมต่อ คุณจะเชื่อมต่อเข้าสู่ Windows 10 Console Session และเห็น Desktop ของ User จะเห็นทุก Action ของ User แต่จะควบคุม Session ไม่ได้ (View mode)

เคล็ดลับ เพื่อจบ Shadow Session กด Alt+* บน Desktop Computer หรือ Ctrl+* บน RDS Server

ถ้าตรวจสอบ Network Connections ด้วย TCPView จะเห็นว่าเป็น RemoteRPC Connection (ไม่ใช่ RDP ที่ใช้ Port TCP/3389) หมายถึง Random TCP Port จาก High RPC Range ถูกใช้สำหรับ Shadow Connection Mstsc.exe สร้าง Connection ด้าน Client ที่เชื่อมต่อ และ rdpsa.exe หรือ rdpsaproxy.exe (ขึ้นอยู่กับ Windows 10 Build) ประมวลผล Connection ด้าน Client ดังนั้น RemoteRPC ต้องเปิดใช้งานบน Client:

HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server
"AllowRemoteRPC"=dword:00000001

Remote Desktop Shadowing พร้อมใช้งานใน Windows 10 / 8.1 และ Windows Server 2012 R2 / 2016 / 2019 สำหรับ Windows 7 SP1 (Windows Server 2008 R2) Clients ต้องติดตั้ง RDP Client version 8.1 — KB2830477 (ต้องติดตั้ง Updates ต่อไปนี้ก่อน — KB2574819 และ KB2857650)

ดังนั้น Remote Desktop Shadowing สามารถใช้แทน Remote Assistance หรือ TeamViewer ในเครือข่ายท้องถิ่นหรือองค์กรได้