Pwershell script to login to a server RRS feed

  • General discussion

  • I'm very new to this scripting world. I want to write a powershell script to login to a windows server of same domain and restart a windows service.

    Please guide.

    • Changed type Bill_Stewart Friday, July 7, 2017 4:12 PM
    • Moved by Bill_Stewart Friday, July 7, 2017 4:12 PM This is not "scripts on demand"
    Thursday, June 1, 2017 3:14 PM

All replies

  • Get-Help Invoke-Command
    Thursday, June 1, 2017 3:35 PM
  • This might not be a trivial request. Does the service have any dependencies on other services? Do any other services depend on the service? What research have you done, what have you tried so far, and with what results?

    -- Bill Stewart [Bill_Stewart]

    Thursday, June 1, 2017 4:46 PM
  • Hi Bill.

    The service don't depend on any other service. Whenever an applicaiton's process goes down we need to run the service to restart the processes. So I want to automate whole this set. And avoid the manual login every time followed by service restart.

    So I thought writing a script to login to a remote application server and restarting the service.

    Friday, June 2, 2017 8:24 AM
  • Get-Service servicename -computer remotepc | Start-Service


    Friday, June 2, 2017 8:28 AM