title: Setting GPO security filter with powershell Set-GPPermissions cmdlet
body: <p>According to <a href="http://technet.microsoft.com/en-us/library/ee461038.aspx" rel="nofollow">Microsoft</a> the cmdlet <a href="http://technet.microsoft.com/en-us/library/ee461038.aspx" rel="nofollow">Set-GPPermissions</a> accepts the option "-replace":</p>
  
  <blockquote>
    <p>"This ensures that the existing permission level is replaced by the new permission level."</p>
  </blockquote>
  
  <p>I import a GPO from PowerShell. After that I want to set the security filters. After importing, before setting the security filter, the Security Filtering of the GPO is "Authenticated Users". Now I want to remove that filter option and replace it with "myGroup". To do so I use the following command:</p>
  
  <pre><code>Set-GPPermissions -Name "myGPO" -PermissionLevel GpoApply -TargetName "myGroup" -TargetType Group -replace
  </code></pre>
  
  <p>The results are that there is a new security filter added which references "myGroup", but the Group "Authenticated Users" is not being removed. The Powershell cmdlet is not <em>replacing</em> the filter, it's <em>adding</em> it.</p>
  
  <p>Hints?</p>
  
  <p>Thanks in advance!</p>