Remove-GPLink

Removes a GPO link from a site, domain or OU.

구문

Parameter Set: LinkbyGUID
Remove-GPLink -Guid <Guid> -Target <String> [-Domain <String> ] [-Server <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: LinkbyName
Remove-GPLink [-Name] <String> -Target <String> [-Domain <String> ] [-Server <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

자세한 설명

The Remove-GPLink cmdlet deletes the link between a GPO and a specified site, domain, or OU. This cmdlet does not delete the actual GPO or any other links between the specified GPO and other sites, domains, or OUs.

매개 변수

-Domain<String>

Specifies the domain for this cmdlet. You must specify the fully qualified domain name (FQDN) of the domain (for example: sales.contoso.com).

For the Remove-GPLink cmdlet:

-- The GPO that is linked must exist in this domain.

-- The Active Directory container (site, domain, or OU) that is linked must exist in a domain that has a trust relationship with this domain.

Note: 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 the Domain parameter by its built-in alias, "domainname". For more information, see about_Aliases.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Guid<Guid>

Specifies the GPO for which to remove the link by its globally unique identifier (GUID). The GUID uniquely identifies the GPO.

You can also refer to the Guid parameter by its built-in aliases, "id" and "gpoid". For more information, see about_Aliases.

별칭

없음

필수 여부

true

위치

named

기본값

없음

파이프라인 입력 적용 여부

true (ByPropertyName)

와일드카드 문자 허용 여부

false

-Name<String>

Specifies the GPO for which to remove the 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.

별칭

없음

필수 여부

true

위치

1

기본값

없음

파이프라인 입력 적용 여부

true (ByValue)

와일드카드 문자 허용 여부

false

-Server<String>

Specifies the name of the domain controller that this cmdlet contacts to complete the operation. You can specify either the fully qualified domain name (FQDN) or the host name. For example:

FQDN: DomainController1.sales.contoso.com

Host Name: DomainController1

If you do not specify the name by using the Server parameter, the PDC emulator is contacted.

You can also refer to the Server parameter by its built-in alias, "dc". For more information, see about_Aliases.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Target<String>

Specifies the LDAP distinguished name of the site, domain, or OU from which to remove the link. For example, for the "MyOU" organizational unit in the contoso.com domain, the LDAP distinguished name is "ou=MyOU,dc=contoso,dc=com".

별칭

없음

필수 여부

true

위치

named

기본값

없음

파이프라인 입력 적용 여부

true (ByPropertyName)

와일드카드 문자 허용 여부

false

-Confirm

cmdlet을 실행하기 전에 확인 메시지가 표시됩니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-WhatIf

cmdlet이 실행될 경우 결과 동작을 표시합니다. cmdlet이 실행되지 않습니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.

  • Microsoft.GroupPolicy.GpoLink

    An object that represents the link between a GPO and a site, domain, or OU.

출력

출력 유형은 cmdlet이 내보내는 개체의 유형입니다.

  • Microsoft.GroupPolicy.Gpo

    Remove-GPLink returns the GPO for which the link has been removed.

예제

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

Description

-----------

This command removes the link between the "MyGPO" GPO and the "MyOU" organizational unit in the contoso.com domain.

PS C:\> Remove-GPLink -Name "MyGPO" -Target "ou=MyOU,dc=contoso,dc=com" 

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

Description

-----------

This command removes the link between the "MyGPO" GPO and the default site.

PS C:\> Remove-GPLink -Name "MyGPO" -Target "Default-First-Site-Name"

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

Description

-----------

This command removes the links for all the GPOs that are linked to the "MyOU" organizational unit in the contoso.com domain.

Get-GPInheritance is used to get a Microsoft.GroupPolicy.Som object for the OU. The GpoLinks property of the SOM object contains all the GPO links for GPOs that are linked to the OU (links that are inherited from higher-level containers are not included). This collection is piped into Remove-GPLink. The GPOs for which links have been removed are returned.

PS C:\> (Get-GPInheritance -Target "ou=myou,dc=contoso,dc=com").GpoLinks | Rem ove-GPLink 

관련 항목

New-GPLink

Set-GPLink