65.9K
CodeProject is changing. Read more.
Home

RemoteConsole

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.20/5 (2 votes)

Aug 28, 2007

CPOL

2 min read

viewsIcon

33390

downloadIcon

674

Remote console allows to send commands to a remote computer located on the Internet

Introduction

Sometime ago, I had to install a Windows service on a computer, located outside of our network, that downloads and prints different documents. This service had to be up 24/7 but the printing process had a lot of problems which stopped this critical service time and again. Even if I fix some problems and the application becomes more stable, I understand that it is necessary to have a control on that service. A simple and flexible solution was to create a remote console which allows to send console commands from my computer to a remote computer.

With net start/stop "myService" I can start/stop my service and with net start I can check if my service is up. The nice part of this solution is that if you want new functionalities later, you can write an EXE, copy on the client side and launch from remote console.

Background

To be very flexible, I decided to use webservices for communication and I built other two applications. One of them, RemoteAdmin, has to be installed on the client side and RemoteControl will be on your side. The flow is quite simple. RemoteAdmin checks the webservice every five seconds for new commands. If it finds something to do, it will execute the command and will return the output to the webservice. RemoteControl will check every five seconds if there is new output from the clients and at the same time can send commands to the webservice. The webservice acts like a small storage for both parts. It keeps a list with all computer's current commands and current outputs.

Install the Application

To install the application:

  1. Create a virtual directory called RemoteAdmin. Set this directory to point to the RemoteAdminWebService folder:

Screenshot - 3.jpg

  1. Install the RemoteAdmin using RemoteAdminSrv.exe from Setup folder (this binary will connect to localhost\RemoteAdminWebService). You can also use the batch files to install manually.
  2. Launch RemoteControl and in the white area, type console commands like ipconfig /all.

Using RemoteConsole

The left panel will show all RemoteAdmin clients connected to the webservice. From here, you can also select a computer.

In the black area, you can see the console output of the selected computer.

From the white area, you can send the commands to the selected computer.

The result after command ipconfig /all is as shown below:

Screenshot - 4.jpg

The output after command net start is as shown below:

Screenshot - 5.jpg

History

  • 28th August, 2007: Initial post