B
BLUE
EventLogPermission permission =
new EventLogPermission(EventLogPermissionAccess.Administer, ".");
permission.PermitOnly();
If I use the above statements before CreateEventSource when I go to Event
Viewer i see:
The description for Event ID (0) in Source (GTJR) cannot be found.
The local computer may not have the necessary registry information or
message DLL files to display messages from a remote computer.
You may be able to use the /AUXSOURCE = flag to retrieve this description.
See Help and Support for details.
The following information is part of the event: Hello world.
I do not understand from MSDN if we must use EventLogPermission or if they
are optional.
I want to run an app on a server (so when no user is logged) and to log its
events:
- which are user permissions when no user is logged?
- what is the user when no user is logged?
I test if he is an administrator to create an event source:
WindowsPrincipal principal = new
WindowsPrincipal(WindowsIdentity.GetCurrent());
return principal.IsInRole(WindowsBuiltInRole.Administrator);
- to schedule the run I can use task scheduler or it does not work when no
user is logged and I have to create a windows service?
Thanks,
Luigi.
new EventLogPermission(EventLogPermissionAccess.Administer, ".");
permission.PermitOnly();
If I use the above statements before CreateEventSource when I go to Event
Viewer i see:
The description for Event ID (0) in Source (GTJR) cannot be found.
The local computer may not have the necessary registry information or
message DLL files to display messages from a remote computer.
You may be able to use the /AUXSOURCE = flag to retrieve this description.
See Help and Support for details.
The following information is part of the event: Hello world.
I do not understand from MSDN if we must use EventLogPermission or if they
are optional.
I want to run an app on a server (so when no user is logged) and to log its
events:
- which are user permissions when no user is logged?
- what is the user when no user is logged?
I test if he is an administrator to create an event source:
WindowsPrincipal principal = new
WindowsPrincipal(WindowsIdentity.GetCurrent());
return principal.IsInRole(WindowsBuiltInRole.Administrator);
- to schedule the run I can use task scheduler or it does not work when no
user is logged and I have to create a windows service?
Thanks,
Luigi.