Registry Modify Query

Welcome Forums General PowerShell Q&A Registry Modify Query

This topic contains 3 replies, has 2 voices, and was last updated by

 
Keymaster
8 months, 1 week ago.

  • Author
    Posts
  • #95209

    Participant
    Points: 1
    Rank: Member

    If I run regedit elevated I can manually change values on the below key:(DeviceState)
    HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\{cbeade13-69b3-45e3-967e-bcd9b24ad4f7}\'DeviceState'

    If I try an elevated Powershell ISE Session locally at that Regi location :Set-ItemProperty -Path . -Name DeviceState -Value 1

    I get

    Set-ItemProperty : Requested registry access is not allowed.
    At line:1 char:1
    + Set-ItemProperty -Path . -Name DeviceState -Value 1
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : PermissionDenied: (HKEY_LOCAL_MACH...e-bcd9b24ad4f7}:String) [Set-ItemProperty], SecurityException
    + FullyQualifiedErrorId : System.Security.SecurityException,Microsoft.PowerShell.Commands.SetItemPropertyCommand

    Is my issue here the 'under the hood' mechanics of how set-itemproperty is accessing the registry provider?

  • #95266

    Keymaster
    Points: 1,619
    Helping HandTeam Member
    Rank: Community Hero

    Probably. The ISE is honestly not a valid "test" environment; what's it do in the PowerShell console?

  • #95269

    Participant
    Points: 1
    Rank: Member

    Hi DON,

    Same result

  • #95274

    Keymaster
    Points: 1,619
    Helping HandTeam Member
    Rank: Community Hero

    Interesting. I'd have to really dig into the ACLs and stuff, but it does seem like it's going through a different underlying set of APIs that somehow aren't working.

The topic ‘Registry Modify Query’ is closed to new replies.