Hi there..
I am trying to write a utility to write entries to a custom log within the Eventvwr.
I have the code running quite nicely from a CLI under an Admin's credentials, however I am having trouble granting the application READ/WRITE access to allow the creation of the custom log name if it doesn't already exist.
The code I am trying for this is:
The above code was taken from MSDN article on the RegistryPermission Class, and the function doesn't error.
When I re-compile the app and run under a normal user account, I recieve an error "5 - Requested registry access is not allowed".
Can anyone help me to set the correct permissions please? I need to have access to the a/m key as this is where the eventlog entries are made, the app needs to be able to write here so that a new custom log may be created an a LogSource is based upon the application name and username.
Thanks in adv..
I am trying to write a utility to write entries to a custom log within the Eventvwr.
I have the code running quite nicely from a CLI under an Admin's credentials, however I am having trouble granting the application READ/WRITE access to allow the creation of the custom log name if it doesn't already exist.
The code I am trying for this is:
Code:
Private Function GetPerms()
Try
Dim f as New RegistryPermission(RegistryPermissionAccess.Read, _
"HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services")
f.AddPathList(RegistryPermissionAccess.Write, _
"HKEY_LOCAL_MACHINE\SYSYTEM\ControlSet001\Services\EventLog")
Catch Ex As Exception
console.writeline (err.number & ":- " & ex.message)
End Try
The above code was taken from MSDN article on the RegistryPermission Class, and the function doesn't error.
When I re-compile the app and run under a normal user account, I recieve an error "5 - Requested registry access is not allowed".
Can anyone help me to set the correct permissions please? I need to have access to the a/m key as this is where the eventlog entries are made, the app needs to be able to write here so that a new custom log may be created an a LogSource is based upon the application name and username.
Thanks in adv..