Re: windows service with its own event log



Hi John,

In order to create a new Event Source, you need to be a member of the Administrators group. One workaround is to have a separate program that creates the source for you, then you can run just this program from an admin account, and your service can still run under "non-admin" credentials.

Regards,

Bennie Haelen

John Grandy wrote:
Unless I make the account under which my Windows Service runs a member of local Administrators, I get startup failures if I include the following code in the OnStart() event :

 if(!EventLog.SourceExists("MyLog"))
 {
   EventLog.CreateEventSource("My Log", "Application");
 }
 EventLog appLog = new EventLog();
 appLog.Source = eventSource;
 appLog.WriteEntry("Test Log Entry",EventLogEntryType.Information);


Seems extreme to make a Service's credentials a member of local Administrators ... any ideas ?





.



Relevant Pages

  • Re: Administrator cant change security
    ... administrators group on the domain member can configure permissions on any ... computers can not reliably contact a domain controller. ... I'm signing on as Administrator on a second Windows 2003 server that is ...
    (microsoft.public.windows.server.security)
  • Re: Security groups being removed
    ... be the expected behavior because of the AdminSDHolder thread on the DC ... This object is used to control the permissions of user accounts that are ... members of the built-in Administrators or Domain Administrators groups. ... a user account is a member of one of these administrative groups because ...
    (microsoft.public.windows.server.sbs)
  • Re: True difference between Domain Admin grp and Administrators Group
    ... is a member of the domain "administrator" group by default. ... The domain admin group not only has local administrator ... group is automatically added to the local "administrators" group. ... Members of this group have full control of the domain. ...
    (microsoft.public.windows.server.general)
  • RE: Permissions
    ... administrative permissions in each domain (Domainb.local ... Create a local group on the member server in the ... >Symptom 1 often occurs when the domain administrators ...
    (microsoft.public.win2000.security)
  • RE: Security groups being removed
    ... and all of the member objects of these groups: ... This object is used to control the permissions of user accounts that are ... members of the built-in Administrators or Domain Administrators groups. ... AdminSDHolder thread. ...
    (microsoft.public.windows.server.sbs)