Active Directory · Risk: High · Documentation Verified
Last verified: 2026-10-26
Microsoft GroupPolicy reference: Links a GPO to a site, domain, or OU. The syntax and selected example below are adapted from the pinned Windows Server 2025 reference. Module availability, target configuration and delegated permissions determine whether it can run in your environment. Documentation and parameter text: Microsoft, CC BY 4.0; formatting adapted by Cmdlet World. No execution testing is claimed.
Use an account with the target resource permissions documented for New-GPLink. Modifying administrative cmdlets may require elevation or delegated administration. This catalog does not assert that ordinary users can execute the command.
Supported environments
Windows / GroupPolicy · Windows Server 2025 documentation; feature/module prerequisites apply
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
-Domain
Specifies the domain for this cmdlet. You must specify the fully qualified domain name (FQDN) of the domain. For the New-GPLink cmdlet: - The GPO to link from must exist in this domain. - The Active Directory container to link to must exist in a domain that has a trust relationship with this domain. To specify a domain to link to, use the *Target* parameter. If you do not specify the Domain parameter, the domain of the user that is running the current session is used. If the cmdlet is being run from a computer startup or shutdown script, the domain of the computer is used. For more information, see the Notes section in the full Help. If you specify a domain that is different from the domain of the user that is running the current session (or, for a startup or shutdown script, the computer), a trust must exist between that domain and the domain of the user, or the computer. You can also refer to Domain by its built-in alias, DomainName. For more information, see about_Aliases.
-Enforced
Specifies whether the GPO link is enforced. You can specify Yes or No. By default, GPO links are not enforced. By setting the GPO link to enforced, you ensure the following: - That the settings of the GPO cannot be blocked (by blocking inheritance) at a lower-level Active Directory container. - That the settings of the GPO always take precedence over conflicting settings in GPOs that are linked to lower-level containers. This option should be used sparingly. Casual use of this option complicates troubleshooting.
-Guid (required)
Specifies the GPO to link by its globally unique identifier (GUID). The GUID uniquely identifies the GPO in the domain. You can also refer to the Guid parameter by its built-in alias, Id. For more information, see about_Aliases.
-LinkEnabled
Specifies whether the GPO link is enabled. The acceptable values for this parameter are: Yes or No. By default, Group Policy processing is enabled for all GPO links. You can completely block the application of a GPO for a specific site, domain, or OU by disabling the GPO link for that site, domain, or OU. Disabling a GPO link does not disable the GPO itself. If the GPO is linked to other sites, domains, or OUs, Group Policy continues to process the GPO for each link that is enabled.
-Name (required)
Specifies the GPO to link by its display name. The display name is not guaranteed to be unique in the domain. If another GPO with the same display name exists in the domain, an error occurs. You can use the Guid parameter to uniquely identify a GPO. You can also refer to the Name parameter by its built-in alias, DisplayName. For more information, see about_Aliases.
-Order
Specifies the link order for the GPO link. You can specify a number that is between one and the current number of GPO links to the target site, domain, or OU, plus one. The link order specifies the order of precedence with which GPOs linked to the same Active Directory container are applied. When Group Policy is processed, GPOs with a higher link order number are processed before GPOs with a lower link order number. Therefore, when two GPOs contain conflicting settings, the settings in the GPO with the lower link order number, because it is processed last, overwrites those of the GPO with the higher link order number. A lower number indicates higher precedence. By default, the GPO link is added at the lowest precedence with a link order equal to the number of GPO links to the container, plus one. Link order is a dynamic value because the value may change as GPO links are added and deleted from the container. You can change the link order of a GPO link with the Set-GPLink cmdlet.
-Server
Specifies the name of the domain controller that this cmdlet contacts to complete the operation. You can specify either the FQDN or the host name. If you do not specify the name by using the Server parameter, the primary domain controller (PDC) emulator is contacted. You can also refer to the Server parameter by its built-in alias, DC. For more information, see about_Aliases.
-Target (required)
Specifies the LDAP distinguished name of the site, domain, or OU to which to link the GPO. For example, for the MyOU organizational unit in the contoso.com domain, the LDAP distinguished name is ou=MyOU,dc=contoso,dc=com.
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Prerequisites
Windows with the GroupPolicy module and the Windows feature or management tools that provide it. Confirm target connectivity and version compatibility using the linked Microsoft reference.
Security considerations
This cmdlet changes system state. Review every target and parameter in the official reference, test outside production, and prepare an appropriate backup or rollback. Do not execute the example automatically.
This command links the TestGPO GPO in the domain of the user (or, for a startup or shutdown script, the computer) to the contoso.com domain. If the domain of the user, or the computer, is different than contoso.com, a trust relationship must exist between the two domains. Source: Microsoft, CC BY 4.0; transcript prompt/output removed. This example was not executed.