EventLog question (nobody knows the answer) 
Author Message
 EventLog question (nobody knows the answer)

I have posted this question to several newsgroups and asked a few well-known
gurus, but nobody seemed to know the answer. Any chance you can help?

What I want to do is very simple: when creating an event log entry (using
EventLog class), set up the user field to the identity of the user making
the call. Originally, I thought that EventLog class should do this
implicitly, but it does not, because I get "N/A" in the user fields for all
entries I create, even though the calls are made by a valid Windows user.
And there is no method or property to set the user name. Is there any way to
do this?

Also, how do you prevent the message "For more information, see Help and
Support Center at http://www.*-*-*.com/ ; from being
appended to the event log descriptions? I really doubt that this link has
any information related to the event log messages created by my application.

Thanks in advance.

--
Alek



Sat, 12 Feb 2005 00:38:42 GMT  
 EventLog question (nobody knows the answer)
Alek,

What happens if you set the MachineName property in the EventLog class?

--

Hope this Helps.

Ryan Dawson


Quote:
> I have posted this question to several newsgroups and asked a few
well-known
> gurus, but nobody seemed to know the answer. Any chance you can help?

> What I want to do is very simple: when creating an event log entry (using
> EventLog class), set up the user field to the identity of the user making
> the call. Originally, I thought that EventLog class should do this
> implicitly, but it does not, because I get "N/A" in the user fields for
all
> entries I create, even though the calls are made by a valid Windows user.
> And there is no method or property to set the user name. Is there any way
to
> do this?

> Also, how do you prevent the message "For more information, see Help and
> Support Center at http://go.microsoft.com/fwlink/events.asp" from being
> appended to the event log descriptions? I really doubt that this link has
> any information related to the event log messages created by my
application.

> Thanks in advance.

> --
> Alek



Sat, 12 Feb 2005 10:28:24 GMT  
 EventLog question (nobody knows the answer)
MachineName identifies the computer where the event log resides. This is not
what I am looking for: I am interested in user identity.

--
Alek


Quote:
> Alek,

> What happens if you set the MachineName property in the EventLog class?

> --

> Hope this Helps.

> Ryan Dawson



> > I have posted this question to several newsgroups and asked a few
> well-known
> > gurus, but nobody seemed to know the answer. Any chance you can help?

> > What I want to do is very simple: when creating an event log entry
(using
> > EventLog class), set up the user field to the identity of the user
making
> > the call. Originally, I thought that EventLog class should do this
> > implicitly, but it does not, because I get "N/A" in the user fields for
> all
> > entries I create, even though the calls are made by a valid Windows
user.
> > And there is no method or property to set the user name. Is there any
way
> to
> > do this?

> > Also, how do you prevent the message "For more information, see Help and
> > Support Center at http://go.microsoft.com/fwlink/events.asp" from being
> > appended to the event log descriptions? I really doubt that this link
has
> > any information related to the event log messages created by my
> application.

> > Thanks in advance.

> > --
> > Alek



Sat, 12 Feb 2005 23:58:14 GMT  
 EventLog question (nobody knows the answer)
Using P/Invoke, you have to call the Win32 API "ReportEvent" passing the account SID as argument, the account SID can be retrieved
using the Win32 API LookupAccountName.
Before calling ReportEvent you have to call RegisterEventSource, and you have to call DeregisterEventSource when done.

Willy.

Quote:

> MachineName identifies the computer where the event log resides. This is not
> what I am looking for: I am interested in user identity.

> --
> Alek



> > Alek,

> > What happens if you set the MachineName property in the EventLog class?

> > --

> > Hope this Helps.

> > Ryan Dawson



> > > I have posted this question to several newsgroups and asked a few
> > well-known
> > > gurus, but nobody seemed to know the answer. Any chance you can help?

> > > What I want to do is very simple: when creating an event log entry
> (using
> > > EventLog class), set up the user field to the identity of the user
> making
> > > the call. Originally, I thought that EventLog class should do this
> > > implicitly, but it does not, because I get "N/A" in the user fields for
> > all
> > > entries I create, even though the calls are made by a valid Windows
> user.
> > > And there is no method or property to set the user name. Is there any
> way
> > to
> > > do this?

> > > Also, how do you prevent the message "For more information, see Help and
> > > Support Center at http://go.microsoft.com/fwlink/events.asp" from being
> > > appended to the event log descriptions? I really doubt that this link
> has
> > > any information related to the event log messages created by my
> > application.

> > > Thanks in advance.

> > > --
> > > Alek



Sun, 13 Feb 2005 00:18:13 GMT  
 EventLog question (nobody knows the answer)
Thank you Willy,

I know how to do this using Win32 API. I was hoping for a .NET solution,
which does not require inter-op. I guess there is none. Kind of silly that
such a basic thing was not implemented.

--
Alek



Quote:
> Using P/Invoke, you have to call the Win32 API "ReportEvent" passing the

account SID as argument, the account SID can be retrieved
Quote:
> using the Win32 API LookupAccountName.
> Before calling ReportEvent you have to call RegisterEventSource, and you

have to call DeregisterEventSource when done.
Quote:

> Willy.




Quote:
> > MachineName identifies the computer where the event log resides. This is
not
> > what I am looking for: I am interested in user identity.

> > --
> > Alek



> > > Alek,

> > > What happens if you set the MachineName property in the EventLog
class?

> > > --

> > > Hope this Helps.

> > > Ryan Dawson



> > > > I have posted this question to several newsgroups and asked a few
> > > well-known
> > > > gurus, but nobody seemed to know the answer. Any chance you can
help?

> > > > What I want to do is very simple: when creating an event log entry
> > (using
> > > > EventLog class), set up the user field to the identity of the user
> > making
> > > > the call. Originally, I thought that EventLog class should do this
> > > > implicitly, but it does not, because I get "N/A" in the user fields
for
> > > all
> > > > entries I create, even though the calls are made by a valid Windows
> > user.
> > > > And there is no method or property to set the user name. Is there
any
> > way
> > > to
> > > > do this?

> > > > Also, how do you prevent the message "For more information, see Help
and
> > > > Support Center at http://go.microsoft.com/fwlink/events.asp" from
being
> > > > appended to the event log descriptions? I really doubt that this
link
> > has
> > > > any information related to the event log messages created by my
> > > application.

> > > > Thanks in advance.

> > > > --
> > > > Alek



Sun, 13 Feb 2005 07:09:45 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Nobody knows the answer!

2. I guess nobody can answer this question

3. Thread termination question: Wrong forum or nobody knows?

4. NOBODY is there to answer my problem !!

5. fp10.obj: nobody knows but ...

6. Nobody know anything

7. Does nobody know this?

8. Help: Does nobody know anything about OleMain?

9. Simple question ( for those how knows the answer )

10. Easy ftp question (if you know the answer)

11. Beginner Questions where everybody knows the answer :)

12. EventLog Question

 

 
Powered by phpBB® Forum Software