How to start and and stop a Windows service remotely using PSEXEC? Preferably the syntax to write I tried the cmdlet given below
psexec \\Server -u Administrator -p Somepassword ServiceName
To restart the remote computer, run the following command: If you need to run several commands one by one, it’s better to run the PsExec in the interactive mode on the remote computer. To do this, run the command: Now all the commands that you typed in the command prompt on your local computer, will be executed on the remote lon-srv01 computer.
After running PSEXESVC, a connection is established for data transfer between this service, and the PsExec process on your computer. When the work is completed, PsExec stops the service and automatically removes it from the remote computer.
The SMB port (TCP/445) and UDP/137 ports should be opened on the firewalls between source and target computers. Then PsExec installs and starts the PSEXESVC service using the Windows API functions for managing services.
Bring up an admin Command Prompt (Start > type cmd > Ctrl+Shift+Enter) and then type the following: The NET USE command first creates a connection to the remote computer with the credentials of one of its administrators. Then you can use the SC command to query the status of a service and start/stop or change its startup type. A few examples are:
I can't test this right now, but it ought to be:
psexec \\server -u username -p password net start ArgusCommunityWorkerService
and
psexec \\server -u username -p password net stop ArgusCommunityWorkerService
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With