Som.LinkGpo Method (Int32, Gpo)
Links the specified GPO to the container (site, domain, or OU) that this Som represents.
Namespace: Microsoft.GroupPolicy
Assembly: Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)
Syntax
public GpoLink LinkGpo(
int linkPosition,
Gpo gpo
)
public:
GpoLink^ LinkGpo(
int linkPosition,
Gpo^ gpo
)
member LinkGpo :
linkPosition:int *
gpo:Gpo -> GpoLink
Public Function LinkGpo (
linkPosition As Integer,
gpo As Gpo
) As GpoLink
Parameters
linkPosition
Type: System.Int32The position at which to link the GPO relative to other GPOs that are linked to this container. The link position is 1-based.
gpo
Type: Microsoft.GroupPolicy.GpoThe Gpo to link to this container.
Return Value
Type: Microsoft.GroupPolicy.GpoLink
Returns the GpoLink that represents the link between the GPO and this container.
Exceptions
Exception | Condition |
---|---|
ArgumentException | linkPosition is greater than the current number of GPOs linked to the container. -or- A GPO link already exists between the GPO and the SOM. |
ArgumentNullException | gpo is null. |
ArgumentOutOfRangeException | linkPosition is less than or equal to 0. |
Remarks
The position at which the GPO is linked to the container determines the precedence with which its settings are applied, relative to the settings of other GPOs that are linked directly to the container, when Group Policy is processed on the client. A lower number indicates a higher level of precedence.
See Also
Som Class
Microsoft.GroupPolicy Namespace
Return to top