IS IIS在管理员帐户或用户帐户中运行 [英] IS IIS Runs in Administrator Account or User Account

查看:83
本文介绍了IS IIS在管理员帐户或用户帐户中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



这里我通过网络应用程序开发了一个Windows服务和Web应用程序(asp.net)我想启动Windows Service.its工作正常在开发服务器中。当我通过IIS运行应用程序启动Windows服务时显示此错误。





Dear Friends,

Here i developed one Windows Service and Web Application(asp.net) through web application i want to start the Windows Service.its Working fine in Development Server.When i run the Application through IIS to start the Windows Service its Showing this Error.


Error:
System.InvalidOperationException: Cannot open VMC_SMS_SERVICE service on computer '.'. ---> System.ComponentModel.Win32Exception: Access is denied --- End of inner exception stack trace --- at System.ServiceProcess.ServiceController.GetServiceHandle(Int32 desiredAccess) at System.ServiceProcess.ServiceController.Start(String[] args) at System.ServiceProcess.ServiceController.Start() at Sms_Service_Sms_SmsServiceStartStop.StartWindowsService()





此错误由服务控制器抛出


开发服务器中的
工作正常,但在IIS中遇到问题,所以我想知道如何通过IIS向Windows服务授予权限.WOather IIS适用于用户帐户或管理员帐户。< br $>




问候,



AnilKumar.D



This Error is Thrown by Service Controller

in Development Server its Working fine but In IIS its Getting Problem,So i want to know how to give Permission to Windows Service through IIS.and Wheather IIS will works for User Account or Administrator Account.


Regards,

AnilKumar.D

推荐答案

应用程序作为Windows服务运行,由Windows 服务控制器托管,这与其他应用程序非常不同(您知道,它允许服务运行时)用户登录登录,没有桌面,等等。



即使您可以配置不同的服务在不同的用户帐户下运行,包括通常的用户帐户,它通常不会在任何此类帐户下运行。此外,您应该了解管理员帐户与其他用户帐户没有本质区别;它首先由操作系统安装设置,分配给管理员组,并为该组和成员分配一些预定义的权限集。稍后,您可以创建具有完全相同权限的更多帐户,甚至删除管理员。底线是:对于大多数或所有服务,包括IIS,此类帐户完全不适合。与服务相比,它们习惯于在桌面上工作。



因此,服务通常在本地系统,本地服务等特殊帐户下运行或网络服务。



您可以看到IIS使用的帐户:显示管理工具小程序服务。 (顺便说一句,你可以从命令行启动它作为%windir%\ system32 \ services.msc 。)你会发现在这个名称下运行的IIS服务进程万维网发布服务。



查看NetworkService帐户的权限:http://msdn.microsoft.com/en-us/library/windows/desktop/ms684272%28v=vs.85%29。 aspx [ ^ ]。



这只是为了回答你的确切问题(答案是:没有一个)并且有助于理解服务托管和帐户。



我担心你提供的信息不足以真正解决问题。为此,您应该研究应用程序的运行时并找出抛出异常的位置。详细的日志记录可以提供帮助。



-SA
The application runs as Windows Service which is hosted by the Windows Service Controller, which is very different from other applications (you know, it allow the service running when the user logs out on logs on, without the desktop, and so on).

Even though you can configure different services to run under different user accounts, including "usual" user account, it does not normally run under any of such accounts. Also, you should understand the "Administrator" account is not essentially different from other user accounts; it's just set up by the OS installation first, assigned to "Administrators" group and some predefined sets of privileges are assigned to this group and member. Later on, you can create more accounts with exact same privileges and even remove "Administrator". The bottom line is: for most or all services, including IIS, such accounts are totally unsuitable. They are used to work on a desktop, in contrast to the Services.

So, the Services are usually run under special accounts like "Local System", "Local Service" or "Network Service".

You can see what account is used by IIS: show the "Administrative Tools" applet "Services". (By the way, you can start it from command line as %windir%\system32\services.msc.) You will find IIS service process running under the name like "World Wide Web Publishing Service".

See the privileges of the NetworkService account: http://msdn.microsoft.com/en-us/library/windows/desktop/ms684272%28v=vs.85%29.aspx[^].

This is just to answer your exact question (the answer is: none of them) and help to understand the service hosting and accounts.

I'm afraid you provided not enough information to actually fix the problem. To do this, you should study the runtime of your application and find out where the exception is thrown. Detailed logging can help.

—SA


这篇关于IS IIS在管理员帐户或用户帐户中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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