Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 30-06-2009
Member
 
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.
Reply With Quote
  #2  
Old 30-06-2009
Member
 
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]
Reply With Quote
  #3  
Old 30-06-2009
Member
 
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "powershell remotely restart windows service"
Thread Thread Starter Forum Replies Last Post
Permissions for single remote service restart RichardW Windows Server Help 5 06-10-2011 05:22 PM
How to remotely Block Sim-on service to KMS 9 running device Mudhol Portable Devices 4 02-10-2011 07:45 PM
start service with parameters on restart exotericist Windows Server Help 20 02-12-2009 01:07 AM
Restart Pc Remotely jennifer Networking & Security 3 25-08-2009 11:14 AM
Restart logrotate service Unix'EM Operating Systems 2 08-08-2009 02:21 PM


All times are GMT +5.5. The time now is 01:55 AM.