Howto: Remote CMD into another Windows box

Remote CMD into another Windows system

A colleague of mine was recently running a Web Application Scanner over night on a Windows 8 desktop. In the morning he could not log back in.

There were also a couple of disconnected users also logged in into the system. Restarting the system wasn’t an option because the scan was running from last 2 days.

So we decided to use remote into the Windows box over using Windows Remote shell.

winrs -r:remote_server cmd

This command will give you an interactive command shell of the remote host. Just to confirm type the follow to validate if indeed you are connected to the remote host.

hostname

Since I wanted to logoff all users except the one who is currently running the scan, we would need to get a list of all users currently logged into the system

query user

This command will give you a list of all users, the ID column is important. To logoff a user with ID 1 simply type in this

logoff 1

Note that any unsaved data will be lost for any profile you have logged off.

Click here for a complete list of WINRS commands

Have something to add?

Loading Facebook Comments ...
Loading Disqus Comments ...