1
Vote

Can not impersonate MSUtil object

description

Hi Sir,
 
I create an object ILogRecordset in ASP.NET page and run it under Application Pool with domain account, but this account does not belong to Local Administrators group. So ILogRecordset does not have enough permission to execute the query of Security Windows Events. That's right. But I tried to impersonate my code with another account which has full rights on local but it was still thown an exception "access denied".
 
My code like this:
 
using(Impersonate im = new Impersonate(account))
{
///My code here
}
 
Then, I replace my code using MSUtil by Object Modal (EventEntry, EventLog), everything works fine.
 
Please tell me what I was wrong or how can I use MSUtil in this case.
 
Many thanks/ Tomy

comments