[英]Does Impersonation and running service with logon set to Administrator user is same thing?
I have 1 windows service running on local machine under local system account. 我在本地系统帐户下的本地计算机上运行1 Windows服务。 This service is written in C#. 该服务用C#编写。 I am using impersonation in code to run service code under admin user context. 我在代码中使用模拟在管理员用户上下文下运行服务代码。 If I set logon of service to Administrator account and remove impersonation code from service, then still code will be run under admin user context ? 如果我将服务登录设置为管理员帐户并从服务中删除模拟代码,那么仍将在管理员用户上下文下运行代码? I mean whether these two approach are same or there is something different? 我的意思是这两种方法是相同的还是有所不同?
The 2 approaches are absolutely the same. 这两种方法绝对相同。 You could safely remove any impersonation code from your service and configure it to run under Administrator account in the management console. 您可以安全地从服务中删除任何模拟代码,并将其配置为在管理控制台的Administrator帐户下运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.