Given a username and password how do i impersonate that user and run some code as that user.
And by managed i mean without pinvokes or dllimports
There's a similar question with a great answer here.
Have a look at WindowsImpersonationContext for some more information (also there's another great code sample there)