共用方式為


Remove-AzDnsZone

從資源群組移除 DNS 區域。

語法

Remove-AzDnsZone
      -Name <String>
      -ResourceGroupName <String>
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzDnsZone
      -Zone <DnsZone>
      [-Overwrite]
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Remove-AzDnsZone Cmdlet 會從指定的資源群組永久刪除功能變數名稱系統 (DNS) 區域。 區域中包含的所有記錄集也會一併刪除。 您可以使用 Name 參數或使用管線運算符來傳遞 DnsZone 物件,或者您也可以指定 ZoneNameResourceGroupName 參數。 您可以使用 Confirm 參數和 $ConfirmPreference Windows PowerShell 變數來控制 Cmdlet 是否提示您進行確認。 使用 DnsZone 物件指定區域時(透過管線或 Zone 參數傳遞),如果區域在 Azure DNS 中已變更,則不會刪除該區域,因為本機 DnsZone 物件已擷取 (僅直接在 DNS 區域資源計數為變更的作業、區域內記錄集上的作業不會刪除)。 這會為並行區域變更提供保護。 這可以使用 Overwrite 參數來隱藏,不論並行變更為何,都會刪除區域。

範例

範例 1:移除區域

Remove-AzDnsZone -Name "myzone.com" -ResourceGroupName "MyResourceGroup"

此命令會從名為 MyResourceGroup 的資源群組中移除名為 myzone.com 的區域。

參數

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:False
必要:False
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶

類型:IAzureContextContainer
別名:AzContext, AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Name

指定此 Cmdlet 移除的 DNS 區域名稱。 您也必須指定 ResourceGroupName 參數。 或者,您可以使用 Zone 參數來指定 DNS 區域。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-Overwrite

使用 DnsZone 物件指定區域時(透過管線或 Zone 參數傳遞),如果區域在 Azure DNS 中已變更,則不會刪除該區域,因為本機 DnsZone 物件已擷取 (僅直接在 DNS 區域資源計數為變更的作業、區域內記錄集上的作業不會刪除)。 這會為並行區域變更提供保護。 這可以使用 Overwrite 參數來隱藏,不論並行變更為何,都會刪除區域。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-PassThru

passthru

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ResourceGroupName

指定要移除之區域的資源群組名稱。 您也必須指定 ZoneName 參數。 或者,您可以使用透過管線或 Zone 參數傳遞 DnsZone 物件來指定 DNS 區域。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。

類型:SwitchParameter
別名:wi
Position:Named
預設值:False
必要:False
接受管線輸入:False
接受萬用字元:False

-Zone

指定要刪除的 DNS 區域。 傳遞 DnsZone 物件也可以透過管線傳遞。 或者,您可以使用 ZoneNameResourceGroupName 參數,指定要刪除的 DNS 區域。

類型:DnsZone
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

輸入

輸出

備註

由於刪除 DNS 區域的潛在高影響,根據預設,此 Cmdlet 會提示確認$ConfirmPreference Windows PowerShell 變數是否具有 None 以外的任何值。 如果您指定 ConfirmConfirm:$True,此 Cmdlet 會在執行之前提示您確認。 如果您指定 Confirm:$False,Cmdlet 不會提示您進行確認。