windows-services

how to get logged in user and machine name from window service in c#?

坚强是说给别人听的谎言 提交于 2020-01-02 10:05:31
问题 How to get the logged in user (interactive user) and machine name from window service in c#. When i try Environment and other class to get logged in user name it just returns NT AUTHORITY\SYSTEM from window service. 回答1: The service executes under the SYSTEM account, so that what you see in the Environment class. The machine name should not be a problem (see Gmoliv's comment). Services execute independently from whoever may be logged on: that's one of the main reasons to have them. If you

How to configure IE proxying for the local system account? [closed]

别等时光非礼了梦想. 提交于 2020-01-02 10:04:22
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 8 years ago . See Server Fault: How do I configure proxy settings for LOCAL SYSTEM? I have a Windows service that needs to start up IE with certain proxy settings (e.g. host name and port). If the service is configured to run as some normal user (e.g. me), I can ensure the required IE proxy configuration by programmatically

Create GUI from Windows Service with a Network Log on

冷暖自知 提交于 2020-01-02 08:33:25
问题 I have been reading a lot about executing a GUI application from a Windows Service. The "Allow service to interact with desktop" check box worked for me when the Service runs as the SYSTEM user (I am using Windows XP). Now I need the Service to run as a User defined in a domain (from the network). Everything works fine (even if no user is logged into the machine) but the GUIs are not shown (even if the same network user is logged in!). I know that the GUIs are running, it's just that they are

Create GUI from Windows Service with a Network Log on

佐手、 提交于 2020-01-02 08:32:25
问题 I have been reading a lot about executing a GUI application from a Windows Service. The "Allow service to interact with desktop" check box worked for me when the Service runs as the SYSTEM user (I am using Windows XP). Now I need the Service to run as a User defined in a domain (from the network). Everything works fine (even if no user is logged into the machine) but the GUIs are not shown (even if the same network user is logged in!). I know that the GUIs are running, it's just that they are

Create GUI from Windows Service with a Network Log on

心不动则不痛 提交于 2020-01-02 08:32:14
问题 I have been reading a lot about executing a GUI application from a Windows Service. The "Allow service to interact with desktop" check box worked for me when the Service runs as the SYSTEM user (I am using Windows XP). Now I need the Service to run as a User defined in a domain (from the network). Everything works fine (even if no user is logged into the machine) but the GUIs are not shown (even if the same network user is logged in!). I know that the GUIs are running, it's just that they are

How to limit stdout.log file size when running Apache Tomcat as Windows service?

人盡茶涼 提交于 2020-01-02 01:26:46
问题 Is there any way that I could limit the size of the stdout.log file in Apache Tomcat? When running as a service system.out statements go to the stdout file. But I need to have a mechanism where I can control the size of the stdout log file by creating new files after reaching 2GB size or something like that. As of now a new file is created everyday but that is not sufficient. 回答1: In Windows you can go to go to Program Files\Apache Software Foundation\Tomcat6.0\bin and run tomcat6w.exe as

Visual Studio refuses to build project due to missing assembly reference that isn't missing

假如想象 提交于 2020-01-02 00:51:44
问题 I'm building a c# windows service and has added a couple of assembly references (to other projects of my own) to my project. I get the following error when I build: "Error 25 The type or namespace name 'TestClass' could not be found (are you missing a using directive or an assembly reference?" Interestingly enough, the reference path in the csproj-file is correct, and on top of that, classes and namespaces from the referenced project, that according to Visual Studio is missing, is being

An error in the MSDN walk-through - “How to: Host WCF in a Windows Service Using TCP”

旧城冷巷雨未停 提交于 2020-01-01 19:52:47
问题 I've been banging my head against a brick-wall the past 2 days trying to successfully use this example on MSDN: How to: Host WCF in a Windows Service Using TCP If you follow the example through and place the Consumer application within the same solution then it runs successfully - even if the service is turned off ! If the service is switched on and the consumer application is published to say a different network drive then it will not run because the WCF is not listening. The following piece

Error stopping a Windows Service

自古美人都是妖i 提交于 2020-01-01 19:38:14
问题 I am using PowerShell 1.0 on Windows Server 2003 x64. When executing the following statement, there is error below. Not every time this error occurs, and if this error occurs and I execute this command again, there is no error again! It is so weird. Any ideas what is wrong? Stop-Service "SQLServerAgent" -Force -ErrorAction:stop WARNING: Waiting for service 'SQL Server Agent (MSSQLSERVER) (SQLSERVERAGENT)' to finish stopping... out-lineoutput : The OS handle's position is not what FileStream

How can I restart a Windows service application written in Delphi?

一笑奈何 提交于 2020-01-01 19:12:12
问题 I have a Windows service written in Delphi. One of the third-party resources it uses occasionally gets corrupted, and the only way I've found to fix the situation is to exit and restart the program. I can detect when the resource is corrupted from within the program, and I can tell Windows to restart the service after it stops, but I can't figure out how to have the service tell itself to stop. The program is pretty simple. I created a service application in what seems to be the normal way. I