473,564 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to read the message of a system event log

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. Do I need to somehow use
EventLogPermiss ion? I can't find any examples of how to use it properly.
Does someone know how to correctly read the system event log messages?

--
-----------
Thanks,
Steve
May 3 '07 #1
8 2462
"SteveT" <St****@newsgro ups.nospamwrote in message
news:62******** *************** ***********@mic rosoft.com...
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. Do I need to somehow use
EventLogPermiss ion? I can't find any examples of how to use it properly.
Does someone know how to correctly read the system event log messages?

--
-----------
Thanks,
Steve

Are you sure you run this program from a local disk? Programs loaded from a
shared network resource don't have the permission to read from the
eventlogs.
Willy.

May 3 '07 #2
This is being run on my local machine. I am an "administra tor" and thought
that I could at least read the messages of the event logs. But, in this
case, the system messages are being denied access.
--
-----------
Thanks,
Steve
"Willy Denoyette [MVP]" wrote:
"SteveT" <St****@newsgro ups.nospamwrote in message
news:62******** *************** ***********@mic rosoft.com...
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. Do I need to somehow use
EventLogPermiss ion? I can't find any examples of how to use it properly.
Does someone know how to correctly read the system event log messages?

--
-----------
Thanks,
Steve


Are you sure you run this program from a local disk? Programs loaded from a
shared network resource don't have the permission to read from the
eventlogs.
Willy.
May 3 '07 #3
"SteveT" <St****@newsgro ups.nospamwrote in message
news:31******** *************** ***********@mic rosoft.com...
This is being run on my local machine. I am an "administra tor" and
thought
that I could at least read the messages of the event logs. But, in this
case, the system messages are being denied access.
So you are sure the program gets loaded from a local disk, right?
In that case, there shouldn't be a problem to read from the eventlog (except
from the "security" log).
Please post the exact exception message and possibly a complete sample of
the code that illustrates the issue.
Note, that the "administra tor" account is disabled on Vista and that, as per
default, all "administrators " run a normal users, unless you run
"elevated".

Willy.
May 3 '07 #4
Did anyone ever find the answer to this? I am doing a similar thing in Powershell. I can confirm that the account I am using is an admin (I am using Longhorn server where the admin account behaves as it always has by default). Also, I am able to read other parts of the security log, including the expansion strings. For some reason I cannot read the message.

I am using System.Diagnost ics.EventLog to access the event log (and the Get-EventLog cmdlet also shows this behavior, not surprising because it uses System.Diagnost ics.EventLog)

From http://www.developmentnow.com/g/36_2...-event-log.htm

Posted via DevelopmentNow. com Groups
http://www.developmentnow.com
Jun 5 '07 #5
Willy,

I am using VS2008 Beta 2. I can correclty read the messages from the
Application and System event logs now. However, I can't read anything from
the Security event logs. You made a comment about that in your previous
email. Do you know how I may read the Security EventLogs?
--
-----------
Thanks,
Steve
"Willy Denoyette [MVP]" wrote:
"SteveT" <St****@newsgro ups.nospamwrote in message
news:31******** *************** ***********@mic rosoft.com...
This is being run on my local machine. I am an "administra tor" and
thought
that I could at least read the messages of the event logs. But, in this
case, the system messages are being denied access.

So you are sure the program gets loaded from a local disk, right?
In that case, there shouldn't be a problem to read from the eventlog (except
from the "security" log).
Please post the exact exception message and possibly a complete sample of
the code that illustrates the issue.
Note, that the "administra tor" account is disabled on Vista and that, as per
default, all "administrators " run a normal users, unless you run
"elevated".

Willy.

Aug 14 '07 #6
Thanks for your reply Steve,

The requirement to elevate the program(if you want it to run under
administrator privilege from begining) is due to the Vista UAC feature:

# User Account Control Overview
http://technet.microsoft.com/en-us/w.../aa906021.aspx

Here is a web article that mentioned several means to make a program run
with administrator rights:

#Vista UAC: 8 ways how to elevate an application to run it with
Administrator rights
http://4sysops.com/archives/vista%E2...elevate-an-app
lication-to-run-it-with-administrator-rights/

also, for application developer, Vista compatible program support using an
embeded manifest(as embeded resource) to indicate that this program need
elevation at the startup time:

#How to embed a manifest in an assembly: let me count the ways...
http://blogs.msdn.com/cheller/archiv...a-manifest-in-
an-assembly-let-me-count-the-ways.aspx

#Windows Vista - Demand UAC elevation for an application by adding a
manifest using mt.exe
http://community.bartdesmet.net/blog...Windows-Vista-
_2D00_-Demand-UAC-elevation-for-an-application-by-adding-a-manifest-using-mt
..exe.aspx

Hope this also helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.



Aug 16 '07 #7
Thank you. Your links pointed me to a location where I learned how to create
a manifest file properly. It now seems to be working. Thanks again.
--
-----------
Thanks,
Steve
"Steven Cheng[MSFT]" wrote:
Thanks for your reply Steve,

The requirement to elevate the program(if you want it to run under
administrator privilege from begining) is due to the Vista UAC feature:

# User Account Control Overview
http://technet.microsoft.com/en-us/w.../aa906021.aspx

Here is a web article that mentioned several means to make a program run
with administrator rights:

#Vista UAC: 8 ways how to elevate an application to run it with
Administrator rights
http://4sysops.com/archives/vista%E2...elevate-an-app
lication-to-run-it-with-administrator-rights/

also, for application developer, Vista compatible program support using an
embeded manifest(as embeded resource) to indicate that this program need
elevation at the startup time:

#How to embed a manifest in an assembly: let me count the ways...
http://blogs.msdn.com/cheller/archiv...a-manifest-in-
an-assembly-let-me-count-the-ways.aspx

#Windows Vista - Demand UAC elevation for an application by adding a
manifest using mt.exe
http://community.bartdesmet.net/blog...Windows-Vista-
_2D00_-Demand-UAC-elevation-for-an-application-by-adding-a-manifest-using-mt
.exe.aspx

Hope this also helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.



Aug 17 '07 #8
You're welcome:)

Have a nice day!

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Aug 20 '07 #9

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

Similar topics

4
4413
by: Mike Dole | last post by:
I'm working on a client - server application based on the 'How to Sockets Server and How to Sockets Client' code from the Visual Basic ..NET Resource Kit. Since I want to be able to send 'big strings' instead of 'one liners' I check the streams for terminators. I'm having problems with the connection, I've been looking and debugging for 2...
10
1301
by: Andrew | last post by:
Hi ALL, I have a javascript code which i register using page.RegisterClientScriptBlock() in my btnFinish() button_click event. I noticed that the debugger will run thru the whole event for my button, before launching the javascript code. I would like to put some c# code in the event if the javascript alert = true, as well to do some...
8
7013
by: dbuchanan | last post by:
Hello, What does this error mean? "The event click is read-only and cannot be changed" This is a design-time error. It is displayed instead of the form. Here is the full text \\ "One or more errors encountered while loading the designer. The errors
4
7273
by: Seok Bee | last post by:
Dear Experts, I have created a script to extract the Event Logs from the system into an excel sheet. The logs are separated into 2 worksheets (Application Log and System Log). After this excel file being created, it will be sent out via email to the list of recipients. I run the script on my notebook (also developed on th same machine) it...
0
679
by: Arno | last post by:
Hi, I've written a class for client-socket connection, but I get a lot of times the error message "Unable to read data from the transport connection" when restart reading the stream with socket.BeginRead in the Sub SocketIncomingMsg. I'm debugging now for weeks, but I can't detect where it's going wrong. the part of code where it fails:
7
7344
by: sergio-p | last post by:
I had no luck in my google search for this answer. Does anyone know if it's possible to read the entries in the Windows Event Log of the server running my PHP page? I'm trying to create an itranet page that lists errors from the server event log.... I'd prefer a pure PHP solution, but I'd be happy to try other alternatives that involve call...
3
14632
by: Mike | last post by:
I know there are server tools out there for this but are admins won't run them on test servers. what I need is a way to read the event view --system for a particular event. I need this to run every 15 minutes and when this event is logged I need an email to be sent to myself and another developer. Is there a way to do this?
1
4048
by: Marc Bartsch | last post by:
Hi, My C# app throws the following exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. From what I read so far I found that the problem can be connected to P/Invoke and that the places at which this exception is thrown might not reflect the...
5
3444
by: =?Utf-8?B?bXBhaW5l?= | last post by:
Hello, I am completely lost as to why I can't update a DropDownList inside a DetailsView after I perform an insert into an object datasource. I tried to simply it down to the core demostration: default.aspx:
0
7665
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7583
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7642
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6255
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.