Remove-GPO

Remove-GPO

Deletes a GPO.

構文

Parameter Set: ByGUID
Remove-GPO -Guid <Guid> [-Domain <String> ] [-KeepLinks] [-Server <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ByName
Remove-GPO [-Name] <String> [-Domain <String> ] [-KeepLinks] [-Server <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

詳細説明

The Remove-GPO cmdlet removes the GPO container and data from the directory service and the system volume folder (SysVol).

パラメーター

-Domain<String>

Specifies the domain in which you want to remove a GPO. You must specify the fully qualified domain name (FQDN) of the domain (for example: SalesDomain.Contoso.com).

If you do not specify the Domain parameter, the domain of the computer that you are logged on to is used.

If you specify a domain that differs from the domain of your user object, a trust must exist between the domain from which you want to remove the GPO and the domain of your user object.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

true (ByPropertyName)

ワイルドカード文字を許可する

false

-Guid<Guid>

Specifies the GPO to delete by its globally unique identifier (GUID). The GUID uniquely identifies the GPO.

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

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

true (ByPropertyName)

ワイルドカード文字を許可する

false

Preserves the links to the GPO in the specified domain (including OUs) and all sites when the GPO is removed.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Name<String>

Specifies the GPO to delete 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, ByPropertyName)

ワイルドカード文字を許可する

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

-Confirm

コマンドレットを実行する前に、ユーザーに確認を求めます。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-WhatIf

コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

  • Microsoft.GroupPolicy.Gpo

    A GPO to be deleted. Collections that contain GPOs from different domains are not supported.

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • None

    This cmdlet does not output any objects.

  • When you delete a GPO, by default, all links to that GPO in the domain of the GPO are deleted. To delete a link to a GPO, you must have permission to link Group Policy Objects for the organizational unit or domain. If you do not have rights to delete a link, the GPO is deleted, but the link remains. Links from other domains and sites are not deleted. The link to a deleted GPO appears in the GPMC as Not Found. To delete Not Found links, you must either have permission on the site, domain, or organizational unit containing the link, or ask someone with sufficient rights to delete it.

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

Description

-----------

Removes the GPO that has the GUID 50cc3e45-0b14-46dd-8b4d-afa012bc331c from the contoso.com domain. Because the KeepLinks parameter is specified, links between the GPO and all sites, and links between the GPO and all containers in the domain are preserved.

PS C:\> Remove-GPO -guid 50cc3e45-0b14-46dd-8b4d-afa012bc331c -Domain contoso.com -KeepLinks

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

Description

-----------

Removes the "TestGPO" GPO from the domain of the user that is running the session (or, for startup and shutdown scripts, the domain of the computer). Because the KeepLinks parameter is not specified, links between the GPO and all sites, and links between the GPO and all containers in the domain are deleted.

PS C:\> Remove-GPO -Name TestGPO

関連トピック

Get-GPO

New-GPO