Event Log User

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know how to set the User when writing to a Windows Event log?

I would have thought the API would have used the current users context,
However all I get is N\A.
 
Hello James,

It's because manages WriteEvent set null for the UsersSid param of underneath
WinAPI ReportEvent method
You can see this in reflector

byte[] buffer1 = null;
if (!UnsafeNativeMethods.ReportEvent(new HandleRef(this, this.writeHandle),
(short) type, category, eventID, buffer1, ...)

You need to use PInvoke to call ReportEvent


JL> Does anyone know how to set the User when writing to a Windows Event
JL> log?
JL>
JL> I would have thought the API would have used the current users
JL> context, However all I get is N\A.
JL>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top