it should still fix some issue You mean interactive? Logoff, if anything fails, spawn a request to logoff.exe Logon - nope. that is a GINA module that can go in front (look it up in google), but this is a very tricky beast to do. The security system in windows is pretty well isolated for obvious reasons (i.e. security).
IIS 7.5: Setting 'app pool user' as the anonymous user programmatically