473,320 Members | 2,097 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,320 software developers and data experts.

Event Log: Access Denied, Permission

Hi All,

I am trying to create and write to Event Log on Windows Server 2003 system
in a simple C# application.

However, it throws the exception saying that Access is denied.

What permission and settings are required for creating and writing the event
logs on the system.

Any help or pointer.

Thanks in advance
Sachin
Nov 16 '05 #1
4 18898
On Sat, 29 Jan 2005 10:57:10 -0000, Sachin wrote:
I am trying to create and write to Event Log on Windows Server 2003 system
in a simple C# application.

However, it throws the exception saying that Access is denied.

What permission and settings are required for creating and writing the event
logs on the system.

Any help or pointer.


Typically you can write to the event log with no problems, but you need to
use an existing log file and existing event sources unless you run under
high privileges.

One option, if you want your own log or sources, is to create an installer
that would be run be an admin on the machine to create your log and
sources. Then your app can write to them under its restricted privileges.

Info on creating an installer and then using installutil.exe can be found
in the following articles:

EventLogInstaller Class
http://msdn.microsoft.com/library/en...classtopic.asp

Installer Tool (Installutil.exe)
http://msdn.microsoft.com/library/en...allutilexe.asp
--
Tom Porterfield
Nov 16 '05 #2
Hi,

Can you post the code in question, where you create the EventLog object and
initialize it?

I have never had any problem with the event log, though

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Sachin" <an********@microsoft.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Hi All,

I am trying to create and write to Event Log on Windows Server 2003 system
in a simple C# application.

However, it throws the exception saying that Access is denied.

What permission and settings are required for creating and writing the
event
logs on the system.

Any help or pointer.

Thanks in advance
Sachin

Nov 16 '05 #3
Does the user that the application run under have permissions on the
machine?
Is it a guest user?
You could set the permissions you need directly on the event files at
%SystemRoot%\system32\config\<LogName>
and set the permissions on the registery keys at
HKLM/System/CurrentControlSet/Services/EventLog

Regards
Mohamed El Ashmawy
MEA Developer Support Center
ITWorx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #4
The code is:

EventLog log = new EventLog();
log.Source = "MySource";
log.WriteEntry(...);
------------------------------------

I even tried impersonation but still same error that access is denied.

Does it require any setting on Activey Directory as user is authenticated
againt the active directory
and os is Windows Server 2003.

TIA
Sachin
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:OP**************@tk2msftngp13.phx.gbl...
Hi,

Can you post the code in question, where you create the EventLog object and initialize it?

I have never had any problem with the event log, though

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Sachin" <an********@microsoft.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Hi All,

I am trying to create and write to Event Log on Windows Server 2003 system in a simple C# application.

However, it throws the exception saying that Access is denied.

What permission and settings are required for creating and writing the
event
logs on the system.

Any help or pointer.

Thanks in advance
Sachin


Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Z D | last post by:
Hello, I'm currently using IISv6 & ASP.NET. I was wondering what permissions I need to give to the identity my application pool runs under in order to allow writing to the event log? ...
5
by: Dan Brill | last post by:
Hi, I'm sure this issue has been covered before but after searching around I can't find anything which deals with quite the same set of circumstances or suggests an optimal solution. The...
2
by: orp | last post by:
We are developing an ASP.NET 2.0 (C#) application, and I'm having troubles getting the ASP.NET app. to write to the event log when accessing the web site from a separate client computer. Here's...
6
by: JeffDotNet | last post by:
Writing to a registered source in the Application event log I have an asp.net framework 2.0 app that I created on a winxp machine and now I am deploying it to IIS6 on a win server2003 machine. ...
1
by: cpajoe2001 | last post by:
I am having an issue and after searching around online for a day and half now and finding others with the same problem but yet no solution to my issue I am looking for help. What i have is ServerA...
8
by: =?Utf-8?B?U3RldmVU?= | last post by:
Under Vista, my program, when reading the system event log, will not show the message saying I don't have the right permission. All I wisht to do is read the event log and show the error messages....
8
by: Jeremy Ames | last post by:
I am trying to move an application from my system to a new test system. I really should have tried an easier program first, but I didn't really have a chance. My application was originally written in...
5
by: DotNetDanny | last post by:
Hello Machine: Windows Vista Business, standalone machine (no domain). Installed an old classic ASP webapplication in IIS7, running under a new app.pool with 'NETWORK SERVICE' account (using...
2
by: P1 | last post by:
Hey guys, I'm totally out of my league here, I don't even know how I got stuck with this problem, it's obviously a webmaster issue and I'm just a lowly net admin. The error: Starts here...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.