March 2008 Entries

If you want to write to the Server's Event log from ASP.NET you'll first need to tweak some security settings. The first change is easy, however the second took me a while to find.

Step One:

Grant "Full Control" to the "IIS_WPG" group to the following registry key:

HKLM\SYSTEM\CurrentControlSet\Services\EventLog

Step Two:

One of the security restrictions added to IIS 6 under Windows Server 2003 was much tighter ACLs (Access Control Lists) on the event logs. This restricts what accounts can read and write to the logs (application, system & security). To overcome this you'll need to add the following value. Incase you're worried what security hole I'm opening up for you there's a breakdown of what it means at the end of the post.

(A;;0x0002;;;AU)

Add the above value to the end of the existing "CustomSD" value found at following path (pick relevant one):

HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application

HKLM\SYSTEM\CurrentControlSet\Services\EventLog\System

HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Security

So mine went from:

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)

to: (scroll to all the way to the right to see the change in bold):

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;;0x0002;;;AU)

The value being added is written in Security Descriptor Definition Language (SDDL) and is as follows:

  • A = Access allowed.
  • ;; = token delimiter (don't know why there's two of them?)
  • 0x0002 = Permission to write log files.
  • ;;; = token delimiter (again - don't know why there's three of them?)
  • AU = Authenticated Users.

Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist

I recently stumbled across these Remote Desktop keyboard shortcuts so thought I'd share them...

RDP Session Local Equivalent Description
CTRL + ALT + END CTRL + ALT + DEL Windows Security Dialog
CTRL + ALT + BREAK (none) Toggle RDP from window to Full Screen
ALT + INSERT CTRL + ALT + TAB Cycle through running programs
ALT + HOME WINDOWS Open Start Menu
ALT + DELETE ALT + SPACEBAR Open Control Menu
CTRL + ALT + (num pad) MINUS ALT + PRNT SCREEN Places image of active window on Clipboard
CTRL + ALT + (num pad) PLUS PRNT SCREEN Places image of entire desktop on Clipboard

If anyone has any others let me know...


Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist