JSI Tip 1951. How do I install the Remote Command Service, remotely?


The Remote Command Service, from the Server Resource Kit and Supplement 4, is a tool that provides a secure way to remotely run command line programs. I quote:

Remote Command Service consists of client and server components. The client is a command-line program, Rcmd.exe. The server end, Rcmdsvc.exe, is installed and run as a service. That is, it can be stopped and started locally or remotely via the Control Panel Network application, or locally with the NET START and NET STOP commands. As a service, if configured to start automatically, it will run whenever the system is running, independently of whether a user is locally logged on.

A command session, or "virtual console," is created when a client connects to the server. It is not visible on the desktop, and does not in any way interfere with it. Up to ten clients may be simultaneously connected to the remote command server on a computer, all operating securely and independently of each other.

To install the service remotely, first copy the rcmd*.exe files to %SystemRoot%\System32 and instsrv.exe to %SystemRoot%, on your distribution server. Then run:

RCMDinstall.bat RemoteServerName

where RCMDinstall.bat contains:

@echo Off
if "%1"=="" goto syntax
setlocal
set srv=%1
set loc=\\%srv%\Admin$
copy %SystemRoot%\System32\rcmd*.exe %loc%\System32
copy %SystemRoot%\instsrv.exe %loc%
@echo %%SystemRoot%%\instsrv.exe "Remote Command Server" %%SystemRoot%%\System32\rcmdsvc.exe > %loc%\rcmdinst.bat
@echo exit >> %loc%\rcmdinst.bat
soon \\%srv% cmd /c "%loc%\rcmdinst.bat" 
endlocal
exit
:syntax
@echo A ServerName is required.
exit

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish