我该如何开始使用“网络服务”帐户控制台应用程序 [英] How can i start a console application using the 'network service' account
问题描述
我有一个控制台应用程序,我想为'NT AUTHORITY \网络服务运行,但我不记得怎么做 - 的唯一原因是,我将举办我的服务在一个窗口服务,但对Kerberos认证测试中,我要使用的SPN是已经在域(它确实有代表团启用)
I have a console application that i would like to run as 'NT AUTHORITY\NetworkService', but i cant remember how to do so - the only reason is that i will be hosting my service in a windows service, but for kerberos authentication testing i want to use the spn that is already at the domain (it does have delegation enabled)
总之我可以从一个控制台应用程序以一个窗口服务人员只需转换,但我希望,以防止这一点。
In short i can simply convert it from a console app to a windows service, but i was hoping to keep from that.
有谁知道如何做到这一点?
Does anyone know how to do this?
推荐答案
我不知道它是多么的准确,但它的建议的,这也许是不可能的 - 见<一href="http://www.derkeiler.com/Newsgroups/microsoft.public.windows.server.security/2005-07/0331.html"相对=nofollow>这里。
I don't know how accurate it is, but it is suggested that this might not be possible - see here.
这可能是最简单的将它移植到服务......为了调试的目的,它是相当容易写code,能正常工作或作为服务或作为一个控制台的EXE(使其易于调试,虽然在错误的身份)。我做这一切的时候...
It might be simplest to port it into a service... for debugging purposes, it is fairly easy to write code that can work either as a service or as a console exe (making it easy to debug, albeit in the wrong identity). I do this all the time...
<一个href="http://groups.google.co.uk/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/4d45e9ea5471cba4/4519371a77ed4a74"相对=nofollow>这里是这样的一个例子;在code搜索开关:
Here's an example of this; search in the code for the switches:
case "-c":
case "-console":
即。与-c,它直接运行在code,而不是启动该服务的基础设施。在code也显示了如何让exe文件充当自安装程序,它可以非常方便的。
i.e. with "-c", it runs the code directly, rather than starting the service infrastructure. The code also shows how to have the exe act as a self-installer, which can be very handy.
这篇关于我该如何开始使用“网络服务”帐户控制台应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!