Results 1 to 3 of 3

Thread: powershell remotely restart windows service

  1. #1
    Join Date
    Feb 2009
    Posts
    66

    powershell remotely restart windows service

    I have a project requirement in Python web application which will run as windows services later, one of the main requirement is that the powershell should automatically restart the services, I have a batch file to deploy this application, but I'm still having to remote desktop in to the server to restart the service. Is there any way to script this? Thanks for your help.

  2. #2
    Join Date
    Apr 2008
    Posts
    193

    Re: powershell remotely restart windows service

    If you are well versed with the Python the you could use the sc command-line tool but i don't know how to do it specifically in python.Learning names of commands and command parameters is a significant time investment with most command-line interfaces. SC is a command line program used for communicating with the NT Service Controller and services. USAGE: sc [command] [service name]

  3. #3
    Join Date
    Dec 2008
    Posts
    202

    Re: powershell remotely restart windows service

    When you work with a new command or parameter, you cannot generally use what you already know; you have to find and learn a new name. If you look at how interfaces grow from a small set of tools with incremental additions to functionality, it is easy to see why the structure is nonstandard. With command names in particular, this may sound logical since each command is a separate tool, but there is a better way to handle command names.

    Commands that take parameters have irregular parameter specifications. You cannot use the net start command to start a service on a remote computer. The sc command will start a service on a remote computer, but to specify the remote computer, you must prefix its name with a double backslash.

    for more information:http://technet.microsoft.com/en-us/l.../dd315315.aspx

Similar Threads

  1. Permissions for single remote service restart
    By RichardW in forum Windows Server Help
    Replies: 5
    Last Post: 06-10-2011, 05:22 PM
  2. Replies: 4
    Last Post: 02-10-2011, 07:45 PM
  3. start service with parameters on restart
    By exotericist in forum Windows Server Help
    Replies: 20
    Last Post: 02-12-2009, 01:07 AM
  4. Restart Pc Remotely
    By jennifer in forum Networking & Security
    Replies: 3
    Last Post: 25-08-2009, 11:14 AM
  5. Restart logrotate service
    By Unix'EM in forum Operating Systems
    Replies: 2
    Last Post: 08-08-2009, 02:21 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,796,125.07178 seconds with 16 queries