There are situations when you need to force end a remote user session on a server using Windows PowerShell. This can come in handy if the user’s session is frozen or if there is a need to do it as quickly as possible with a few commands.

In the “Taskbar”, right-click on “Windows PowerShell” and select “Run as Administrator”.

Check all active remote user sessions on the ru-msk-dc-01 server using the command:

qwinsta /server:ru-msk-dc-01

Now end the remote user session “Administrator”. To do this, the next command will need to specify the ID of the remote session.

logoff 3 /server:ru-msk-dc-01 /v

Note that “/v” is used to display the detailed result of the command.

Remote user session “Administrator” successfully completed on server ru-msk-dc-01.

Let’s look again at all active remote user sessions on the ru-msk-dc-01 server using the command:

qwinsta /server:ru-msk-dc-01

The remote user session “Administrator” is no longer in the list of remote sessions on the server ru-msk-dc-01.

Author

Hi, I’m Vladimir Mikhalev, but my friends call me Valdemar. I have a lot of experience in the design and maintenance of various information systems. On my website, you will find detailed and clear guides for setting up IT solutions. Dive into the ocean, full of positive and technology! For cooperation: callvaldemar@gmail.com

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.