473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 2358
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gnaneshwar Babu | last post by:
Hi I am facing a problem with extracting event logs of win32 to a file. Am using the following code to extract eventlogs to file use Win32::EventLog; $handle=Win32::EventLog->new("System",...
1
by: José Joye | last post by:
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...
0
by: Henrik_the_boss | last post by:
Hello all. I have a couple of aspx pages. When something fails in them, I would like them to be able to log to either a database, a logfile, or the application log. All code is in C# I run...
29
by: Patrick | last post by:
I have the following code, which regardless which works fine and logs to the EventViewer regardless of whether <processModel/> section of machine.config is set to username="SYSTEM" or "machine" ...
3
by: Brian Fulford | last post by:
In my application event log... my service logs messages fine... but all the entries have more text than what I assigned to the message text.. ideas why??? The description for Event ID ( 0 )...
1
by: RandyJ | last post by:
I created a custom log by following a walkthrough. It created NewLog1. I logged several things successfully. I then tried to delete it and send my error messages to the Application log. The...
17
by: Chris Podmore | last post by:
When I perform: EventLog.WriteEntry(strSource, strEntry, EventLogEntryType.Error, intEventID) The event viewer reports The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobile )...
7
by: lawrence k | last post by:
Okay, I just backed up my database, just in case. The whole schema for the database is here: http://www.accumulist.com/index.php?whatPage=db.php You can run any SELECT query against this...
0
by: Chris | last post by:
My Code: EventLog EventLog = new EventLog(strLog, ".", strApplication); EventLog.WriteEntry(strApplication, strMsg, EventLogEntryType.Error, intID, shCategory, bMessageByte);
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.