Powershell to add remove computers from group policy security filter

Install Group Policy Management (on a server 2008 R2 or higher)

Then you are able to run import-module grouppolicy

So, to add a computer to a ‘security filter’ you need to add GpoApply (which is both read and apply permissions) and it will then show in the security filtering pane

The command to do so is

Set-GPPermissions -Name “MyTest” -PermissionLevel GpoApply -TargetName “TheComputer” -TargetType Computer

To Remove the computer is quite simple, same command but set permissionlevel to none

Set-GPPermissions -Name “MyTest” -PermissionLevel None -TargetName “TheComputer” -TargetType Computer

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s