HighTechTalks DotNet Forums  

Help on EventLog security ???

Dotnet Security microsoft.public.dotnet.security


Discuss Help on EventLog security ??? in the Dotnet Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
=?Utf-8?B?Y2FsZGVyYXJh?=
 
Posts: n/a

Default Help on EventLog security ??? - 07-19-2007 , 10:20 AM






Dear all,

I am buidling as assembly which logs potentials generated error or exception
in Event viewer.
For that I am through code creating an EventSource for the log before
writing inside.
I have noticed that for creating that source you need to be an administrator
user.
So if my libryr is executed my a client aplication under a normal user
context, I will have an exception error when creating the EventSource.

How can I be an administrator from my code only during the needed time ?
Sure I might change the contect of my code to be an admin and then
impersonate during the execution of my admin part, then probably use the Undo
method to recover to normal user but how ?

My assembly would need also the EvenLog permission i guess ?
As declarative of imperative mode.

thnaks for help
regards
serge

Reply With Quote
  #2  
Old   
Nicole Calinoiu
 
Posts: n/a

Default Re: Help on EventLog security ??? - 07-20-2007 , 09:20 AM






"calderara" <calderara (AT) discussions (DOT) microsoft.com> wrote

Quote:
Dear all,

I am buidling as assembly which logs potentials generated error or
exception
in Event viewer.
For that I am through code creating an EventSource for the log before
writing inside.
I have noticed that for creating that source you need to be an
administrator
user.
So if my libryr is executed my a client aplication under a normal user
context, I will have an exception error when creating the EventSource.

How can I be an administrator from my code only during the needed time ?
Sure I might change the contect of my code to be an admin and then
impersonate during the execution of my admin part, then probably use the
Undo
method to recover to normal user but how ?
You won't be able to do this unless the user knows administrative account
credentials. A better approach would be to register the event log source
during the installation of the application, which is presumably performed
under an administrative user context.


Quote:
My assembly would need also the EvenLog permission i guess ?
To write to a previously registered event log source,
EventLogPermission\Write for the target event log (presumably the local
machine event log in this case). Locally installed code is granted this
permission under default CAS policy.


Quote:
As declarative of imperative mode.
Sorry, but I don't understand what you mean by this.

Quote:
thnaks for help
regards
serge






Reply With Quote
  #3  
Old   
Nicole Calinoiu
 
Posts: n/a

Default Re: Help on EventLog security ??? - 07-20-2007 , 09:20 AM



"calderara" <calderara (AT) discussions (DOT) microsoft.com> wrote

Quote:
Dear all,

I am buidling as assembly which logs potentials generated error or
exception
in Event viewer.
For that I am through code creating an EventSource for the log before
writing inside.
I have noticed that for creating that source you need to be an
administrator
user.
So if my libryr is executed my a client aplication under a normal user
context, I will have an exception error when creating the EventSource.

How can I be an administrator from my code only during the needed time ?
Sure I might change the contect of my code to be an admin and then
impersonate during the execution of my admin part, then probably use the
Undo
method to recover to normal user but how ?
You won't be able to do this unless the user knows administrative account
credentials. A better approach would be to register the event log source
during the installation of the application, which is presumably performed
under an administrative user context.


Quote:
My assembly would need also the EvenLog permission i guess ?
To write to a previously registered event log source,
EventLogPermission\Write for the target event log (presumably the local
machine event log in this case). Locally installed code is granted this
permission under default CAS policy.


Quote:
As declarative of imperative mode.
Sorry, but I don't understand what you mean by this.

Quote:
thnaks for help
regards
serge






Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.