how to access registry

Y

Yoshitha

Hi
I am developing web application through which i've to write and read the
values from the registry.
When i set impersonate property to "false" it is displaying exception "
Requested Registry Access is not allowed"
so then i changed impersonate to "true" and it is reading values from the
registry and writing into the registry.

but when i runing the same aplication in same system now am getting the
exception "requested registry access is not allowed" though i've set
impersonate property to "true"

Can anybody tell me how to solve this problem.
Its urgent for me.
Thanx in advance
Yoshitha
 
Y

Yanir

There a number of possible causes for your problem:
1. Your logged on as a different user.
When you use impersonation, the aspnet process is running as the user
that was authenticated with the IIS. Since you are running on your own
machin, I presume you use Windows Authentication and the logged on user
is the user that runs the process.
If you are accidentally logged on as a different user with less
privileges and no permission to write to the registry you will see that
message.

2. Your own account permissions has changed.
For the same reason as 1, this can happen if your own account had
permissions to write to the registry but now it doesn't have.

3. Your authentication mode has changed.
If your IIS was set to Windows Authentication, but now it is set to
"Anonymous access", the IIS no longer run under the logged on account.
Instead it runs under the IWAM_<machine name> account which is used to
run the IIS process. As a result, the aspnet process will also run as
the IWAM_... account which is a low privileges account.

To solve your problem I would choose not to use impersonation.
I would instead try to give the ASPNET user (which runs the aspnet
process when you don't use impersonation) specific privileges to the
registry.
But I'm not a security expert, so you should check the implications
carefully before doing it this way.

Yanir
 

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

Top