Followers

Wednesday, September 24, 2014

How to execute a command from another machine remotely?

How to execute a command from another machine remotely?

1. Make sure both computers are in same workgroup or domain.
2. Enable Admin share in both computers.
Go to Start à Control Panel à System and Security à Windows firewall à Allow a program through Windows Firewall



 Search for File and Printer Sharing and check the boxes to Enable Admin$
Do the same in Server also. 


 Check whether we are connected to server or not. Go to Start and Search using the below,
\\<servername>\c$ (It will prompt for username and password to login to the server)
Try to connect to cmd using the below cmd:

 Check IP Address using ipconfig command

 Now we are working in server remotely.
I am trying to execute one batch file. I am executing one batch file to refresh the cube using CubeRefresh.cmd

One more thing we can observe:
In the server Service one temporary service will be running while executing PsExec commands. It will be stopped and deleted automatically after execution process done.


2 comments:

  1. Nice blog post, was in need of that.

    ReplyDelete
  2. have you install PsTools for running batch script remotely , https://technet.microsoft.com/en-in/sysinternals/bb897553.aspx

    ReplyDelete