Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Non-admin user writing to the Event Log?

Non-admin user writing to the Event Log?

Scheduled Pinned Locked Moved C#
questioncollaboration
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dabs
    wrote on last edited by
    #1

    using( System.Diagnostics.EventLog evtLog = new System.Diagnostics.EventLog( ) ) { evtLog.Source = "MyAppName"; evtLog.WriteEntry( "SomeMessage" ); } Any reason why this would not work when the current user isn't an Administrator? If this is the case, what is the correct way to enable event logging for non-admins? Regards, Daníel


    Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!

    P V 2 Replies Last reply
    0
    • D dabs

      using( System.Diagnostics.EventLog evtLog = new System.Diagnostics.EventLog( ) ) { evtLog.Source = "MyAppName"; evtLog.WriteEntry( "SomeMessage" ); } Any reason why this would not work when the current user isn't an Administrator? If this is the case, what is the correct way to enable event logging for non-admins? Regards, Daníel


      Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      dabs wrote:

      Any reason why this would not work when the current user isn't an Administrator?

      Yup. The sys admins have locked down your event log - you need to get them to open the privileges on them.

      Deja View - the feeling that you've seen this post before.

      My blog | My articles

      1 Reply Last reply
      0
      • D dabs

        using( System.Diagnostics.EventLog evtLog = new System.Diagnostics.EventLog( ) ) { evtLog.Source = "MyAppName"; evtLog.WriteEntry( "SomeMessage" ); } Any reason why this would not work when the current user isn't an Administrator? If this is the case, what is the correct way to enable event logging for non-admins? Regards, Daníel


        Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!

        V Offline
        V Offline
        Vasudevan Deepak Kumar
        wrote on last edited by
        #3

        You can try using impersonation. Ask your administrator to help you with an account that is privileged to write to EventLog.

        Vasudevan Deepak Kumar Personal Homepage
        Tech Gossips
        A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups