从ASP.NET页面启动/停止窗口服务 [英] Start/Stop Window Service from ASP.NET page

查看:185
本文介绍了从ASP.NET页面启动/停止窗口服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个开始/在不同的网络停止服务器的Windows服务的方式

Is there a way to start / stop a windows service of a server in a different network

(不是 \\\\<服务器名称> )?从一个asp.net页面

(not \\<server name>) from an asp.net page?

我试着使用ServiceController的,但如果是在同一网络中这只是工作。

I tried using ServiceController but it's only work if it's in the same network.

推荐答案

RE:ServiceController的<一个href=\"http://stackoverflow.com/questions/818512/how-to-start-stop-a-windows-service-from-an-asp-net-app-security-issues?rq=1\">How开始/从一个ASP.NET应用程序停止Windows服务 - 安全问题

RE: ServiceController How to Start/Stop a Windows Service from an ASP.NET app - Security issues

任何你可以从命令行或做的PowerShell可以从页面中跑(假设应用程序池用户有正确的权限等)

Anything you can do from command line or powershell can be ran from a page (assuming the app pool user has correct permissions etc)

  • http://serverfault.com/questions/429426/how-can-i-connect-to-a-windows-server-using-a-command-line-interface-cli
  • Run Command Prompt Commands
  • How To: Execute command line in C#, get STD OUT results

PowerShell是可能是在远程服务器上管理服务尽管这将需要服务器允许远程PowerShell你的最佳选择。

Powershell is probably your best bet for managing services on a remote server though this will require the server to allow remote powershell.

  • Calling Powershell from C# (ASP.NET) - pass custom object?
  • http://www.codeproject.com/Articles/18229/How-to-run-PowerShell-scripts-from-C

和课程的PowerShell复位的话题/停止远程服务。

and of course for the topic of powershell resetting/stopping remote services.

  • http://www.powershellmagazine.com/2012/08/28/pstip-starting-and-stopping-services-on-remote-computers/
  • powershell-how to start/stop service on remote server-Windows 2008 & prompt for cred?

谷歌绝对是您在这一个朋友:)

Google is definitely your friend on this one :)

这篇关于从ASP.NET页面启动/停止窗口服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆