Powershell Log Off Remote Session

前端 未结 11 1239
情话喂你
情话喂你 2020-12-02 13:15

I am trying to formulate a Powershell command to remotely log off a user. We have a terminal server with a very unstable program that sometimes locks sessions. We have to re

11条回答
  •  感动是毒
    2020-12-02 13:58

    This is oldschool and predates PowerShell, but I have used the qwinsta / rwinsta combo for YEARS to remotely log off stale RDP sessions. It's built in on at least Windows XP and forward (possibly earlier)

    Determine the session ID:

    qwinsta /SERVER:
    

    Remove the session in question:

    rwinsta  /SERVER:
    

提交回复
热议问题