Microsoft KB Archive/251264

From BetaArchive Wiki

Article ID: 251264

Article Last Modified on 2/28/2007


  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Internet Information Services 5.0

This article was previously published under Q251264

IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry


If you run a Visual Basic server-side COM component from an ASP page on Windows 2000, you are not able to use the App.Logevent functionality by default.


By default, components that are run from an ASP page are created under the IUSR_MACHINENAME account. This account is a member of the "guests" group, and Windows 2000 changed the security privileges needed to write the application event log.


WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

In order to give members of the guest group the ability to write to the application event log, you must change the registry value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\RestrictGuestAccess from a 1 to a 0. You must reboot for the change to take effect.


This behavior is by design.


Steps to Reproduce Behavior

  1. Create a new ASP page with the following code:

            dim obj
            set obj = Server.CreateObject("LogEventTest.cLogEvent")
            set obj = nothing
            response.write "Test has been performed.  Check your EventLog to see if changes have been made."
  2. Save the page as Test.asp in your Inetpub\Wwwroot directory.
  3. With Visual Basic 6.0, create an ActiveX .dll file.
  4. From the Project menu, select Properties, and then select Unattended Execution and Retained in Memory.
  5. Rename Class1 as cLogEvent.
  6. Rename the project from project1 to LogEventTest.
  7. Paste the following code into cLogEvent:

    Public Sub TestEventLog()
        App.Logevent "Test of the Event Log"
    End Sub
  8. Compile the .dll file.
  9. Using your browser, navigate to http://Localhost/Test.asp.
  10. Check your eventlog to see if any events were logged.

Keywords: kbinterop kbprb KB251264