Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • Tried a few things with this suggestion. Keep getting the error "You cannot call a method on a null-valued expression" when it executes "$acl = $key.GetAccessControl();". I created a new key called test just to test if it isn't some other problem. So I used TakeRegKeyOwnership "HKLM:\SOFTWARE\Test"; Commented Oct 27, 2023 at 12:21
  • This looks like it will work for taking ownership, but I assume OP wanted to set ownership to someone else (which would involve SeRestorePrivilege). Commented Oct 27, 2023 at 13:08
  • After rereading the post, I think that assumption is not accurate based on #2 item in the question stating 2. Change owner to myself. I'll dig more if the OP states this is the case and something is still not working since my latest comment about the format of the reg key value to pass to the function call. Commented Oct 28, 2023 at 13:17
  • sorry for the delayed response. I have tried with a number of variations including "SOFTWARE\Test" but unfortunately it makes no difference. Commented Oct 30, 2023 at 9:50
  • @VomitIT-ChunkyMessStyle I have followed the same process - set SYSTEM as owner manually, ran logic from your link. Here is the result: Exception calling "GetExportedTypes" with "0" argument(s): "The invoked member is not supported in a dynamic assembly." At C:\temp\Test-Permission.ps1:7 char:9 Commented Oct 31, 2023 at 12:52