Writing to eventlog

L

Leszek

Hello!

I'm creating application, that will get data from SQL and show it. The end
of it is writing to log informations from which table it was readed.
And there is a problem - Requested registry acces is not allowed.
I know, that it is running in context of ASP.NET (or Network Service), but
how can i do this, that will run as "someuser", that will be a domain user?
Maybe there is other method for it?

Leszek
 
G

Guest

Dear Leszek:

Due to security reason, i think web application may not access the registry
content.

Hope this can help u!
Regards,
Joe Tsui
 
M

Mark Rae

I'm creating application, that will get data from SQL and show it. The end
of it is writing to log informations from which table it was readed.
And there is a problem - Requested registry acces is not allowed.
I know, that it is running in context of ASP.NET (or Network Service), but
how can i do this, that will run as "someuser", that will be a domain
user?
Maybe there is other method for it?

If your app is running on an intranet server that you or your company
controls, you can do this easily with impersonation. Basically, you create a
domain user account and tell your app run under that account. Then, you
assign whatever privileges you need to the account to make your app work. Do
a Google search for ASP.NET & impersonation. If necessary, you can encrypt
the account's username and password using the ASPNET_SETREG utility.

However, if this is a public website hosted with a 3rd party ISP, chances
are you won't be able to do any of the above, so you'll have to find another
solution. One thing I do is, instead of writing application errors to the
Event log, I email them to myself - not ideal, but it works.
 
L

Leszek

Thank you very much! It was that! :)


U¿ytkownik "Mark Rae said:
If your app is running on an intranet server that you or your company
controls, you can do this easily with impersonation. Basically, you create
a domain user account and tell your app run under that account. Then, you
assign whatever privileges you need to the account to make your app work.
Do a Google search for ASP.NET & impersonation. If necessary, you can
encrypt the account's username and password using the ASPNET_SETREG
utility.

However, if this is a public website hosted with a 3rd party ISP, chances
are you won't be able to do any of the above, so you'll have to find
another solution. One thing I do is, instead of writing application errors
to the Event log, I email them to myself - not ideal, but it works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top