There is a registry key on Win Server 2008 R2,
HKCR:\CLSID\{76A64158-CB41-11D1-8B02-00600806D9B6}
whose owner is not Administrator. It is TrustedInstaller. Now to make Remote DCOM/WMI connection working, I need to give Administrator the permission to have Full Control over this key and ownership as well. As this needs to be done on several machines, I was hoping I could do this using Powershell. I followed these
Controlling Registry ACL Permissions with Powershell
Change the owner of directories with powershell
but I still get this error
Exception calling "OpenSubKey" with "3" argument(s): "Requested registry access is not allowed."
The code I am trying to run is simple
$key = [Microsoft.Win32.Registry]::ClassesRoot.OpenSubKey(
"CLSID\{76A64158-CB41-11D1-8B02-00600806D9B6}",
[Microsoft.Win32.RegistryKeyPermissionCheck]::ReadWriteSubTree,
[System.Security.AccessControl.RegistryRights]::TakeOwnership
)
echo $key
Any ideas on how to change ownership of this key? I believe once the ownership is changed to Administrator, I will be able to change permissions using Set-Acl.