windows-services

How to auto login to windows account?

假如想象 提交于 2019-12-04 19:11:40
I am researching ways to auto login to a windows server, so applications can be restarted on reboot if the server crashes. Do windows services load before or after a user logs in? Can a windows service be used to login to an account? If not, is there any way to use some sort of login script to facilitate automatically loggin in? Services run regardless of whether a user logs on. If you need an application to run all the time, have you considered converting it to a service? Auto-logon is a security risk. For auto login. Here is one of them: To use Registry Editor (Regedt32.exe) to turn on

Error stopping a Windows Service

二次信任 提交于 2019-12-04 18:35:52
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 expected. Do n ot use a handle simultaneously in one FileStream and in Win32 code or another F ileStream

WiX - Install Windows Service and give permissions

二次信任 提交于 2019-12-04 18:23:59
问题 We are required to give a user permissions to Start, Stop, and Query status of an installed service. In WiX 2.0, this xml would have worked: <ServiceInstall Id="ServiceInstaller" Type="ownProcess" Name="$(var.ServiceName)" DisplayName="$(var.ServiceName)" Description="Our service description" Start="demand" Account="LocalSystem" ErrorControl="ignore" Interactive="no"> <Permission User="Everyone" ServiceQueryStatus="yes" ServiceStart="yes" ServiceStop="yes" /> </ServiceInstall> <ServiceControl

Error 1001: The Specified Service Already Exists. Cannot remove existing service

北战南征 提交于 2019-12-04 17:24:56
问题 I have a service. I installed it a while ago. I need to do an update to the service. I went to the Add/Remove Programs and looked for my service, and it is not installed there. I looked at services.msc and it is there, stopped. I was able to start it and stop it. I ran a command prompt as administrator and ran sc delete [Service Name], and recieved "The specified service does not exist as an installed service." I did a sc query in the command prompt, and it is not returned. I right clicked on

C#: Simple Windows Service gives Security Exception

ぃ、小莉子 提交于 2019-12-04 17:09:22
问题 I am doing the walkthrough in the following link: http://msdn.microsoft.com/en-us/library/zt39148a%28VS.80%29.aspx I have followed it exactly, line by line. I installed the service successfully, however, when I try to run it, the following error message appears: "An unhandled exception ("System.Security.SecurityException') occurred in MyNewService.Exe [5292]. I have seen that for many people it works, but some people get this exception, though I could not find an answer. Does anyone have an

Using Ninject with a Windows Service

霸气de小男生 提交于 2019-12-04 16:55:13
问题 Any good examples of using Ninject with a Windows Service? I'm not sure what if any extensions I need. Also, not sure what the Composition Root should be? Any good examples of using Ninject with a Windows service out there? 回答1: A windows service does not differ much from a regular command line application in regard to dependency injection. The straight-forward composition root is your Main method. The way I usually have done it is create the StandardKernel there with a module in which my

How to run PostgreSQL as a service in windows?

允我心安 提交于 2019-12-04 16:31:34
I installed postgreSQL binaries in windows 7 32bit operating system; I can start the server from cmd but I cant run it as a windows service. This is the error that I'm getting when I try to start the service manually: "The postgreSQL service on local computer started and then stopped. some services stop automatically if they are not in use by other servces or programs" All I need to do is; after booting to windows when I double clicked my java application I need to run my app smoothly without any database errors. I cannot do this because postgreSQL is not running as a windows service. I found

How can I give a windows service access on a remote machine in case of Workgroup?

故事扮演 提交于 2019-12-04 16:27:54
I'm working on a Windows Service that one of its tasks is archiving files on remote machine but I've a problem regarding access privileges in case of Workgroup. The simplest way is to mirror the username and password on both machines, creating the same account on both machines, then run your service under that account. As you're in a workgroup and not a domain the remote login will work, but once you're in a domain that no longer works. You cannot use any of the built in service accounts (Network Service, Local Service, Local System for this) You can run it under user account that has access

Handle exception on service startup

若如初见. 提交于 2019-12-04 16:20:00
问题 I'm writing a series of Windows services. I want them to fail if errors are thrown during startup (in OnStart() method). I had assumed that merely throwing an error in OnStart() would do this, but I'm finding that instead it "Starts" and presents me with a message stating "The service has started, but is inactive. Is this correct?" (Paraphrase). How do I handle the error so it actually fails to start the service? 回答1: if you are running .NET 2.0 or higher, you can use ServiceBase.Stop to stop

.NET Windows Service - Architectural Decisions

点点圈 提交于 2019-12-04 16:12:27
I currently have a Windows Service which continually runs throughout the day. It has multiple threads which kick off: tasks daily to update cache tasks weekly to do cleanup 24/7 task to import XML into SQL Server tasks which run for around 12 hours per day kicking off a console application to manage ETL The tasks are not the important part of this question but it gives you the idea that this Windows service has grown to be a monster. It manages the imports of somewhere in the region of 300 million records per day. It is hectic, but it works. This iteration of development is giving me a chance