title: Create Registry key and values, disable inheritance set no permissions
body: <p>I am trying to create a registry key and some values and then turn off  inheritance and set permissions (Actually to no permissions) Is this possible to do as you are creating the keys and values?</p>
  
  <p>I see a lot of posts on setting inheritance to on but not much to turn it off and set no permissions. I realize "why would you want to do this?" but it is a requirement of the partner.</p>
  
  <p>The code below creates the object but seems to do nothing with permissions. While it is not the end state it does nothing because inheritance is turned on. 
  So what I need is <strong>disable inheritance and set no permissions.</strong> </p>
  
  <pre><code>$ResgistryKeyPath = "HKLM:\Software\Policies\Microsoft\Windows\RTestBob"
  New-Item $ResgistryKeyPath -Force
  New-ItemProperty -Path $ResgistryKeyPath -Propertytype DWORD -Name 
  Deny_Write -Value 1 -Force | Out-Null
  $AddACL = New-Object System.Security.AccessControl.RegistryAccessRule ("Domain Admins", "FullControl", "Allow")
  $AddACL = New-Object System.Security.AccessControl.RegistryAccessRule ("auth\me", "FullControl", "ObjectInherit,ContainerInherit", "None", "Allow")
  </code></pre>