PowerShell Logo Small


This is the built-in help made by Microsoft for the command 'Set-GPLink', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.


Sets the properties of the specified GPO link.


Set-GPLink [-Domain <String>] [-Enforced <EnforceLink>] [-LinkEnabled <EnableLink>] [-Order <Int32>] [-Server <String>] -Guid <Guid> -Target <String> [-Confirm] [-WhatIf]
Set-GPLink [-Name] <String> [-Domain <String>] [-Enforced <EnforceLink>] [-LinkEnabled <EnableLink>] [-Order <Int32>] [-Server <String>] -Target <String> [-Confirm]
[-WhatIf] [<CommonParameters>]

Search powershellhelp.space


The Set-GPLink cmdlet sets the properties of a GPO link.

You can set the following properties:

-- Enabled. If the GPO link is enabled, the settings of the GPO are applied when Group Policy is processed for the site, domain or OU.

-- Enforced. If the GPO link is enforced, it cannot be blocked at a lower-level (in the Group Policy processing hierarchy) container.

-- Order. The order specifies the precedence that the settings of the GPO take over conflicting settings in other GPOs that are linked (and enabled) to the same site,
domain, or OU.



Online Version: http://go.microsoft.com/fwlink/?linkid=287734




-------------------------- EXAMPLE 1 --------------------------

C:\PS>Set-GPLink -Name TestGPO -Target "ou=MyOU,dc=contoso,dc=com" -LinkEnabled Yes

GpoId : c25daa3e-5d05-43b3-87ca-0a237882fd63
DisplayName : Test2GPO
Enabled : True
Enforced : False
Target : OU=MyOU,DC=contoso,DC=com
Order : 1



This command enables the link between the "TestGPO" GPO and the MyOU organizational unit in the contoso.com domain. The Enforced and Order properties are not changed.

-------------------------- EXAMPLE 2 --------------------------

C:\PS>Set-GPLink -Name TestGPO -Domain north.contoso.com -Target "dc=south, dc=contoso, dc=com" -LinkEnabeled Yes -Enforced Yes -Order 1



This command enables the link between the "TestGPO" GPO in the north.contoso.com domain and the south.contoso.com domain. The link is set to enforced, so it cannot be
blocked at lower-level containers (for example OUs in the south.contoso.com domain). Because the order is set to 1, the settings of the "testGPO" GPO will be applied with
the highest precedence (except for enforced links) when Group policy is processed for the south.contoso.com domain container.

-------------------------- EXAMPLE 3 --------------------------

C:\PS>set-gplink -guid 77c5285d-952e-4559-94ef-a02f5c107799 -target "test-site" -enforced yes

GpoId : 77c5285d-952e-4559-94ef-a02f5c107799
DisplayName : TestGPO
Enabled : True
Enforced : True
Target : CN=test-site,cn=Sites,CN=Configuration,DC=contoso,DC=com
Order : 1



This command sets the enforced property of the link between the GPO that has ID 77c5285d-952e-4559-94ef-a02f5c107799 and the test site. Inheritance cannot be blocked for
this link at containers that are at lower-levels of the Group Policy hierarchy.