Re: EventLog access through ASP.Net app.

From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 11/26/03


Date: Tue, 25 Nov 2003 17:48:30 -0600

Generally, the ASPNET account has rights to write to the event log. The
problem is that since ASPNET is just a user, it cannot create new event logs
or event sources. I've also seen it fail when it tries to verify that the
event source exists, so calling that method might not work either.

What I usually do is make sure the event log source is installed when the
website is deployed (by an administrator), and then just write to the event
source from your code without bothering to check if the source exists.

I don't think the sandboxing approach will likely work because this is
probably a user identity problem, not a Code Access Security problem unless
you have the website running with less than Full Trust.

I also don't think that doing impersonation is necessary if you just create
the event source at deployment time.

HTH,

Joe K.

"JimN" <anonymous@discussions.microsoft.com> wrote in message
news:015b01c3b38d$79d41a50$a501280a@phx.gbl...
> I ahve an ASP.Net app for which I want to be able to log
> events to the Windows 2000 server event log under a special
> log name. I encountered the initial security exceptionwhen
> I first tried this in code and then did some research on
> the subject. I think I've found two seperate ways to
> accomplish what I want to do:
> 1. Use "sandboxing" by writing a class library in a
> strong-named assembly that I install in the GAC which I
> then call into from my ASP.Net app.
> 2. Use wrapped Win32 API calls to perform impersonation,
> which, I understand, requires that I grant "Act as Part of
> Operating system" priviledge to the ASPNET user.
>
> Which do the users of this group suggest I use for the best
> security and portability to other, possibly new, Windows
> servers?



Relevant Pages

  • redirector service?
    ... I noticed a few problem in my application event log, ... Event Type: Error ... Event Source: Perflib ... see Help and Support Center at ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Performance Data Open error on ASP.Net /SBS2000
    ... filling up the Application Event Log with bursts of entries several times ... Event Type: Error ... Performance data for this service will not be available. ... Event Source: SQLSERVERAGENT ...
    (microsoft.public.windows.server.sbs)
  • Re: Server Application Error
    ... > Event Source: W3SVC ... was 'The server process could not be started because the configured identity ... Microsoft Online Support site located at: ... >> Please look in the Windows Event Log. ...
    (microsoft.public.inetserver.iis)
  • Re: Error : "Event ID: 1000 Source: Userenv"
    ... My reply is at the bottom of your sent message: ... > In my event log I found below error. ... > Event Type: Error ... > Event Source: Userenv ...
    (microsoft.public.win2000.general)
  • XP SP1 Deployment via Group Policy
    ... When trying to update a Windows XP Pro workstation with SP1 using update.msi ... through group policy I get the following errors in the workstation ... application event log; ... Event Source: Application Management ...
    (microsoft.public.windowsxp.security_admin)