Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OverRiding Users Security Priveledges

Status
Not open for further replies.

tEkHEd

IS-IT--Management
Jan 29, 2003
261
GB
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:

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..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top