Can't read/write to Registry

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default Can't read/write to Registry

    Why I always get 'Requested registry access is not allowed' when i try to
    Read/Write to Windows Registry from ASP service. I use ASP NET account?
    Also granted full permissions to required Registry keys.
    What is the problem?

    TIA


    Nikolay Petrov Guest

  2. Similar Questions and Discussions

    1. Cannot write to Windows Registry (VB .NET)
      I cannot write to windows registry using ASP .NET account. I have made a key in HKEY_LOCAL_MACHINE\Software and granted full access to ASP .NET...
    2. How to read the windows registry?
      I can successfully open the 'WScript.Shell' COM object but cannot seem to access the 'HKEY_CURRENT_CONFIG' root system. I am trying to read the...
    3. Unable to write to Windows Registry using XML Web Service
      Hiya, at this very moment I'm trying to write an XML Web Service for reading and writing configuration/registry settings. But for some reason I...
    4. can flash write to registry?
      i'm not certain, but i believe that distributing a .REG file (text file with registry modification instructions in it) and running it in the flash...
    5. File system get auto change from read-write to read-oly
      I have a very strange file system with OS Redhat 7.2 The file system is read-write, but some how it randomly changes to read-only at any time....
  3. #2

    Default Can't read/write to Registry

    Why I always get 'Requested registry access is not allowed' when i try to
    Read/Write to Windows Registry from ASP service. I use ASP NET account?
    Also granted full permissions to required Registry keys.
    What is the problem?

    TIA


    Nikolay Petrov Guest

  4. #3

    Default Re: Can't read/write to Registry

    Your code is in the CodeGroup Internet/Intranet cause it's ASP.NET - that
    blocks the access.

    --
    Daniel Fisher(lennybacon)
    MCP ASP.NET C#
    Blog: [url]http://www.lennybacon.com/[/url]


    "Nikolay Petrov" <johntup2_nospam_@mail.bg> wrote in message
    news:e4IrHCYzEHA.3820@TK2MSFTNGP11.phx.gbl...
    > Why I always get 'Requested registry access is not allowed' when i try to
    > Read/Write to Windows Registry from ASP service. I use ASP NET account?
    > Also granted full permissions to required Registry keys.
    > What is the problem?
    >
    > TIA
    >

    Daniel Fisher\(lennybacon\) Guest

  5. #4

    Default Re: Can't read/write to Registry

    Your code is in the CodeGroup Internet/Intranet cause it's ASP.NET - that
    blocks the access.

    --
    Daniel Fisher(lennybacon)
    MCP ASP.NET C#
    Blog: [url]http://www.lennybacon.com/[/url]


    "Nikolay Petrov" <johntup2_nospam_@mail.bg> wrote in message
    news:e4IrHCYzEHA.3820@TK2MSFTNGP11.phx.gbl...
    > Why I always get 'Requested registry access is not allowed' when i try to
    > Read/Write to Windows Registry from ASP service. I use ASP NET account?
    > Also granted full permissions to required Registry keys.
    > What is the problem?
    >
    > TIA
    >

    Daniel Fisher\(lennybacon\) Guest

  6. #5

    Default Re: Can't read/write to Registry

    I hear about Code Groups for first time. What are they?
    Any workaround to my prob?


    "Daniel Fisher(lennybacon)" <info@(removethis)lennybacon.com> wrote in
    message news:%231jSgJYzEHA.2316@TK2MSFTNGP15.phx.gbl...
    > Your code is in the CodeGroup Internet/Intranet cause it's ASP.NET - that
    > blocks the access.
    >
    > --
    > Daniel Fisher(lennybacon)
    > MCP ASP.NET C#
    > Blog: [url]http://www.lennybacon.com/[/url]
    >
    >
    > "Nikolay Petrov" <johntup2_nospam_@mail.bg> wrote in message
    > news:e4IrHCYzEHA.3820@TK2MSFTNGP11.phx.gbl...
    >> Why I always get 'Requested registry access is not allowed' when i try to
    >> Read/Write to Windows Registry from ASP service. I use ASP NET account?
    >> Also granted full permissions to required Registry keys.
    >> What is the problem?
    >>
    >> TIA
    >>
    >
    >

    Nikolay Petrov Guest

  7. #6

    Default Re: Can't read/write to Registry

    I hear about Code Groups for first time. What are they?
    Any workaround to my prob?


    "Daniel Fisher(lennybacon)" <info@(removethis)lennybacon.com> wrote in
    message news:%231jSgJYzEHA.2316@TK2MSFTNGP15.phx.gbl...
    > Your code is in the CodeGroup Internet/Intranet cause it's ASP.NET - that
    > blocks the access.
    >
    > --
    > Daniel Fisher(lennybacon)
    > MCP ASP.NET C#
    > Blog: [url]http://www.lennybacon.com/[/url]
    >
    >
    > "Nikolay Petrov" <johntup2_nospam_@mail.bg> wrote in message
    > news:e4IrHCYzEHA.3820@TK2MSFTNGP11.phx.gbl...
    >> Why I always get 'Requested registry access is not allowed' when i try to
    >> Read/Write to Windows Registry from ASP service. I use ASP NET account?
    >> Also granted full permissions to required Registry keys.
    >> What is the problem?
    >>
    >> TIA
    >>
    >
    >

    Nikolay Petrov Guest

  8. #7

    Default Re: Can't read/write to Registry

    Hi,

    In general you don't want a web exposed method to read/write from the
    registry. The potential for bottlenecking around the registry access is
    high, and registry access is considered too slow for transactional updates.
    The code access group for internet facing code creates a sand box that
    protects the system from exposure to attacks thru the internet. Disabling
    this protection is not recommended.

    If you need to make periodic adjustments of this type, you may wish to
    create a COM+ component (no transactions) that updates the registry key and
    runs as a different machine account. This is the simplest way to
    circumvent the protections without turning them off. If you do decide that
    you need this functionality to be driven from a web facing request, I
    advise you to never expose this to an unprotected (firewalled, intranet)
    environment, and strongly recommend that this not be considered
    "production" quality design.

    Best regards

    Dan Rogers
    Microsoft Corporation
    --------------------
    >From: "Nikolay Petrov" <johntup2_nospam_@mail.bg>
    >References: <e4IrHCYzEHA.3820@TK2MSFTNGP11.phx.gbl>
    <#1jSgJYzEHA.2316@TK2MSFTNGP15.phx.gbl>
    >Subject: Re: Can't read/write to Registry
    >Date: Thu, 18 Nov 2004 20:23:56 +0200
    >Lines: 28
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    >X-RFC2646: Format=Flowed; Response
    >Message-ID: <#CInfvZzEHA.924@TK2MSFTNGP10.phx.gbl>
    >Newsgroups:
    microsoft.public.dotnet.framework.aspnet,microsoft .public.dotnet.framework.a
    spnet.security,microsoft.public.dotnet.framework.a spnet.webservices,microsof
    t.public.dotnet.framework.webservices,microsoft.pu blic.dotnet.security
    >NNTP-Posting-Host: 212.95.179.134
    >Path:
    cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP10
    ..phx.gbl
    >Xref: cpmsftngxa10.phx.gbl
    microsoft.public.dotnet.framework.aspnet.security: 12329
    microsoft.public.dotnet.framework.aspnet.webservic es:26690
    microsoft.public.dotnet.framework.webservices:7541
    microsoft.public.dotnet.security:8221
    microsoft.public.dotnet.framework.aspnet:277133
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
    >
    >I hear about Code Groups for first time. What are they?
    >Any workaround to my prob?
    >
    >
    >"Daniel Fisher(lennybacon)" <info@(removethis)lennybacon.com> wrote in
    >message news:%231jSgJYzEHA.2316@TK2MSFTNGP15.phx.gbl...
    >> Your code is in the CodeGroup Internet/Intranet cause it's ASP.NET -
    that
    >> blocks the access.
    >>
    >> --
    >> Daniel Fisher(lennybacon)
    >> MCP ASP.NET C#
    >> Blog: [url]http://www.lennybacon.com/[/url]
    >>
    >>
    >> "Nikolay Petrov" <johntup2_nospam_@mail.bg> wrote in message
    >> news:e4IrHCYzEHA.3820@TK2MSFTNGP11.phx.gbl...
    >>> Why I always get 'Requested registry access is not allowed' when i try
    to
    >>> Read/Write to Windows Registry from ASP service. I use ASP NET account?
    >>> Also granted full permissions to required Registry keys.
    >>> What is the problem?
    >>>
    >>> TIA
    >>>
    >>
    >>
    >
    >
    >
    Dan Rogers Guest

  9. #8

    Default Re: Can't read/write to Registry


    Hi,

    In general you don't want a web exposed method to read/write from the
    registry. The potential for bottlenecking around the registry access is
    high, and registry access is considered too slow for transactional updates.
    The code access group for internet facing code creates a sand box that
    protects the system from exposure to attacks thru the internet. Disabling
    this protection is not recommended.

    If you need to make periodic adjustments of this type, you may wish to
    create a COM+ component (no transactions) that updates the registry key and
    runs as a different machine account. This is the simplest way to
    circumvent the protections without turning them off. If you do decide that
    you need this functionality to be driven from a web facing request, I
    advise you to never expose this to an unprotected (firewalled, intranet)
    environment, and strongly recommend that this not be considered
    "production" quality design.

    Best regards

    Dan Rogers
    Microsoft Corporation
    --------------------
    >From: "Nikolay Petrov" <johntup2_nospam_@mail.bg>
    >References: <e4IrHCYzEHA.3820@TK2MSFTNGP11.phx.gbl>
    <#1jSgJYzEHA.2316@TK2MSFTNGP15.phx.gbl>
    >Subject: Re: Can't read/write to Registry
    >Date: Thu, 18 Nov 2004 20:23:56 +0200
    >Lines: 28
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    >X-RFC2646: Format=Flowed; Response
    >Message-ID: <#CInfvZzEHA.924@TK2MSFTNGP10.phx.gbl>
    >Newsgroups:
    microsoft.public.dotnet.framework.aspnet,microsoft .public.dotnet.framework.a
    spnet.security,microsoft.public.dotnet.framework.a spnet.webservices,microsof
    t.public.dotnet.framework.webservices,microsoft.pu blic.dotnet.security
    >NNTP-Posting-Host: 212.95.179.134
    >Path:
    cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP10
    .phx.gbl
    >Xref: cpmsftngxa10.phx.gbl
    microsoft.public.dotnet.framework.aspnet.security: 12329
    microsoft.public.dotnet.framework.aspnet.webservic es:26690
    microsoft.public.dotnet.framework.webservices:7541
    microsoft.public.dotnet.security:8221
    microsoft.public.dotnet.framework.aspnet:277133
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
    >
    >I hear about Code Groups for first time. What are they?
    >Any workaround to my prob?
    >
    >
    >"Daniel Fisher(lennybacon)" <info@(removethis)lennybacon.com> wrote in
    >message news:%231jSgJYzEHA.2316@TK2MSFTNGP15.phx.gbl...
    >> Your code is in the CodeGroup Internet/Intranet cause it's ASP.NET -
    that
    >> blocks the access.
    >>
    >> --
    >> Daniel Fisher(lennybacon)
    >> MCP ASP.NET C#
    >> Blog: [url]http://www.lennybacon.com/[/url]
    >>
    >>
    >> "Nikolay Petrov" <johntup2_nospam_@mail.bg> wrote in message
    >> news:e4IrHCYzEHA.3820@TK2MSFTNGP11.phx.gbl...
    >>> Why I always get 'Requested registry access is not allowed' when i try
    to
    >>> Read/Write to Windows Registry from ASP service. I use ASP NET account?
    >>> Also granted full permissions to required Registry keys.
    >>> What is the problem?
    >>>
    >>> TIA
    >>>
    >>
    >>
    >
    >
    >



    ---------------
    Posted using Community Server NewsReader, Alpha
    Learn more at [url]www.communityserver.org[/url]
    Dan Rogers Guest

  10. #9

    Default RE: Can't read/write to Registry

    I'm trying to create an application log from Visual Studio and ran into the
    'Requested registry access is not allowed' error.

    I'm not sure how much of this is required, but it got things working:

    - Using the WIndows User Account manager I added ASPNET to the power users
    group.

    - In the registry at
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\Eventlog\Application I
    did rt. mouse | permissions | Advanced | selected Power Users | Edit |
    selected Set Value and Create Subkey | save everything

    - In C:\Windows\Microsoft.NET\Framework\v1.1.4322\CONFI G\mmachine.config
    modified the identify impersonate element to <identity impersonate="true"
    userName="myAdminUser" password="myAdminPswd"/>

    Given all the various 'solutions' I've read and how many work/don't its
    pretty clear that when MS just turned on all their security they exposed an
    utter mess. It is pretty clear that it is horribly designed and documented.
    It also seems pretty clear that as I have to disable/modify security in
    various places to get thigns working (including MS apps) that I'm just
    opening the holes back up. The replies from the MS people make it clear that
    they don't understand it much better. What a mess!


    Frank Guest

  11. #10

    Default RE: Can't read/write to Registry

    I'm trying to create an application log from Visual Studio and ran into the
    'Requested registry access is not allowed' error.

    I'm not sure how much of this is required, but it got things working:

    - Using the WIndows User Account manager I added ASPNET to the power users
    group.

    - In the registry at
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\Eventlog\Application I
    did rt. mouse | permissions | Advanced | selected Power Users | Edit |
    selected Set Value and Create Subkey | save everything

    - In C:\Windows\Microsoft.NET\Framework\v1.1.4322\CONFI G\mmachine.config
    modified the identify impersonate element to <identity impersonate="true"
    userName="myAdminUser" password="myAdminPswd"/>

    Given all the various 'solutions' I've read and how many work/don't its
    pretty clear that when MS just turned on all their security they exposed an
    utter mess. It is pretty clear that it is horribly designed and documented.
    It also seems pretty clear that as I have to disable/modify security in
    various places to get thigns working (including MS apps) that I'm just
    opening the holes back up. The replies from the MS people make it clear that
    they don't understand it much better. What a mess!


    Frank Guest

  12. #11

    Default RE: Can't read/write to Registry

    Hi Frank,

    Thanks for sharing your feelings on this. A great deal of thought went
    into defining the changes that were made, and in every case where an impact
    to existing behavior was made, a great deal of thought was given. In this
    particular case, there is definitely a difference of opinion as to what is
    a reasonable practice, from a secure application point of view.

    If you were to ask my advice about "should I add my ASPNET user to the
    power users group, and then change the permissions on the registry and on
    the event logging service to allow an anonymous and unsecured user to
    update my system's core control files", I think my answer would be "what
    are you crazy?". But that's just the response I'd give to a friend or
    professional colleague with whom I was comforatable enough that I know they
    wouldn't interpret my reaction as a personal attack. For the remainder of
    the people, my response would be "We cannot, in good faith, recommend that
    anyone ever consider doing this and considering it an adequate solution."

    The issues that you are opening up here are legion, but primarily
    associated with taking your application out of the sand box. Other issues
    will relate to perf in high volume scenarios. In general, using the
    registry as a data store is a bad idea - it is best suited for system
    settings that change infrequently, or for managing the local logged in
    users user experience.

    Other solutions for writing application log entries include using the
    managed code methods that let you write application log entries, so I'm not
    sure what prevented you from doing this.

    Sorry if I do not project confidence in the approach you have chosen. I
    respect your right to your own approach and conclusions.

    Best regards

    Dan Rogers
    Microsoft Corporation
    --------------------
    >Thread-Topic: Can't read/write to Registry
    >thread-index: AcTZXm1l13msAgfSQSWux/x+hMkYuQ==
    >X-WBNR-Posting-Host: 66.68.170.38
    >From: "=?Utf-8?B?RnJhbms=?=" <Frank@discussions.microsoft.com>
    >References: <e4IrHCYzEHA.3820@TK2MSFTNGP11.phx.gbl>
    >Subject: RE: Can't read/write to Registry
    >Date: Fri, 3 Dec 2004 09:35:05 -0800
    >Lines: 26
    >Message-ID: <98AEDAC1-803D-4DD6-9D83-ACFB85317895@microsoft.com>
    >MIME-Version: 1.0
    >Content-Type: text/plain;
    > charset="Utf-8"
    >Content-Transfer-Encoding: 7bit
    >X-Newsreader: Microsoft CDO for Windows 2000
    >Content-Class: urn:content-classes:message
    >Importance: normal
    >Priority: normal
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >Newsgroups:
    microsoft.public.dotnet.framework.aspnet,microsoft .public.dotnet.framework.a
    spnet.security,microsoft.public.dotnet.framework.a spnet.webservices,microsof
    t.public.dotnet.security
    >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
    >Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGXA03.phx.gbl
    >Xref: cpmsftngxa10.phx.gbl
    microsoft.public.dotnet.framework.aspnet.security: 12506
    microsoft.public.dotnet.framework.aspnet.webservic es:27020
    microsoft.public.dotnet.security:8402
    microsoft.public.dotnet.framework.aspnet:280768
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
    >
    >I'm trying to create an application log from Visual Studio and ran into
    the
    >'Requested registry access is not allowed' error.
    >
    >I'm not sure how much of this is required, but it got things working:
    >
    > - Using the WIndows User Account manager I added ASPNET to the power
    users
    >group.
    >
    > - In the registry at
    >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servi ces\Eventlog\Application
    I
    >did rt. mouse | permissions | Advanced | selected Power Users | Edit |
    >selected Set Value and Create Subkey | save everything
    >
    > - In C:\Windows\Microsoft.NET\Framework\v1.1.4322\CONFI G\mmachine.config
    >modified the identify impersonate element to <identity impersonate="true"
    >userName="myAdminUser" password="myAdminPswd"/>
    >
    >Given all the various 'solutions' I've read and how many work/don't its
    >pretty clear that when MS just turned on all their security they exposed
    an
    >utter mess. It is pretty clear that it is horribly designed and
    documented.
    >It also seems pretty clear that as I have to disable/modify security in
    >various places to get thigns working (including MS apps) that I'm just
    >opening the holes back up. The replies from the MS people make it clear
    that
    >they don't understand it much better. What a mess!
    >
    >
    >
    Dan Rogers Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139