469,651 Members | 1,672 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,651 developers. It's quick & easy.

What is the minimal privilege needed to be able to create an event source in the EventLog?

I know, this kind of question has already been asked. However, I could not
find an answer related to the minimal privilege required to be able to
create a new event Source in the appplication event log.

I have a service app that needs to access shares (therefore, I cannot not
start it using the System account). This service needs not to be run with
particular privilege. So, I use a account member of users' group.

Doing so will fail creating an Event source.

I know that I could pre-create this Event Source using a kind of
installation program. However, this is not a solution I like.
I would prefer to increase a bit the privilege of the user starting the
service (?to which level?)

Thanks,
José

Some code sample ...
// Create the source, if it does not already exist.
if(!EventLog.SourceExists("MySource")){
EventLog.CreateEventSource("MySource", "MyNewLog");
}

// Create an EventLog instance and assign its source.
EventLog myLog = new EventLog();
myLog.Source = "MySource";

// Write an informational entry to the event log.
myLog.WriteEntry("Writing to event log.");
Jul 21 '05 #1
1 2219
I think all you need is registry write permissions. If the source as
already been defined in the registry, than you should be able to write
messages using minimal permissions.

"José Joye" <jose.joye@__No_SPam__bluewin__maPS_oN__.ch> wrote in message
news:#z**************@tk2msftngp13.phx.gbl...
I know, this kind of question has already been asked. However, I could not
find an answer related to the minimal privilege required to be able to
create a new event Source in the appplication event log.

I have a service app that needs to access shares (therefore, I cannot not
start it using the System account). This service needs not to be run with
particular privilege. So, I use a account member of users' group.

Doing so will fail creating an Event source.

I know that I could pre-create this Event Source using a kind of
installation program. However, this is not a solution I like.
I would prefer to increase a bit the privilege of the user starting the
service (?to which level?)

Thanks,
José

Some code sample ...
// Create the source, if it does not already exist.
if(!EventLog.SourceExists("MySource")){
EventLog.CreateEventSource("MySource", "MyNewLog");
}

// Create an EventLog instance and assign its source.
EventLog myLog = new EventLog();
myLog.Source = "MySource";

// Write an informational entry to the event log.
myLog.WriteEntry("Writing to event log.");

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Gnaneshwar Babu | last post: by
29 posts views Thread by Patrick | last post: by
3 posts views Thread by Brian Fulford | last post: by
1 post views Thread by RandyJ | last post: by
17 posts views Thread by Chris Podmore | last post: by
reply views Thread by Chris | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.