Cannot open log for source ‘Custom_Web_Part’. You may not have write access

In a SharePoint site, When I logged in as an administrator, all pages accessed successfully. But as a regular user it scolded me with Access denied Error 🙂

mysite access denied

Enabled the stack trace and Turned off custom error message page to get the actual error.

Error detail: System.ComponentModel.Win32Exception: Access is denied. Below it, in the stack trace, another exception popped: InvalidOperationException: Cannot open log for source ‘My_Web_Part’. You may not have write access.  

Cannot open log for source My_Web_Part. You may not have write access.

Solution:

This is because non-administrators do not have permission to write on the event log. So for this problem, just grant non-administrator users permission to write on the event log.

  1. Open registry editor by typing “Regedit” in the run box.
  2. Navigate to: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Eventlog\Application
  3. Look for CustomSD, it should contain string:
     O:BAG:SYD:(D;;0xf0007;;;AN)(D;;0xf0007;;;BG)(A;;0xf0007;;;SY)(A;;0x7;;;BA) (A;;0x7;;;SO)(A;;0x3;;;IU)(A;;0x3;;;SU)(A;;0x3;;;S-1-5-3)

    The string is formatted as an SDDL, you can find more information about the format at Microsoft’s site.

  4. Now change the value to give the event log’s read-write permission to all authenticated users. To do this, append the string (A;;0x3;;;AU) to the entry CustomSD, So it becomes:

       O:BAG:SYD:(D;;0xf0007;;;AN)(D;;0xf0007;;;BG)(A;;0xf0007;;;SY)(A;;0x7;;;BA) (A;;0x7;;;SO)(A;;0x3;;;IU)(A;;0x3;;;SU)(A;;0x3;;;S-1-5-3)(A;;0x3;;;AU)

registry for my site

It’s a best practice to backup registry before you do any change.

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

One thought on “Cannot open log for source ‘Custom_Web_Part’. You may not have write access

  • August 29, 2017 at 12:38 AM

    Everything is very open with a clear description of
    the issues. It was definitely informative. Your website is
    useful. Thanks for sharing!

    Reply

Leave a Reply