I created a website using ASP.NET and imported MSUtil as a reference. MSUtil.Interop was installes into GAC.
Then I create a code like this:
LogQueryClassClass logQuery = new LogQueryClassClass();
COMEventLogInputContextClassClass evtLog = new COMEventLogInputContextClassClass();
ILogRecordset iLogRecordSet = logQuery.Execute("SELECT top 10 FROM \\abc\security", evtLog);
---------------
I publish this web application on IIS local, identity of this website is a domain account but this account did not belong to Local Admin Group.
I rewrite the code using:
using(Impersonate imp = new Impersonate("account_A","domain","pass"))
{
///My code here
}
account_A is a domain account with full rights on that computer and belongs to Local Admin Group.
But I still get an error, I mean I could not impersonate my code to admin account when I run the application with non-local admin account as identity.
Please help me fix that.
Thanks