你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Remove-AzPrivateDnsRecordSet
从专用 DNS 区域删除记录集。
语法
Remove-AzPrivateDnsRecordSet
-ResourceGroupName <String>
-ZoneName <String>
-Name <String>
-RecordType <RecordType>
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzPrivateDnsRecordSet
-Zone <PSPrivateDnsZone>
-Name <String>
-RecordType <RecordType>
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzPrivateDnsRecordSet
-RecordSet <PSPrivateDnsRecordSet>
[-Overwrite]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzPrivateDnsRecordSet
-ResourceId <String>
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Remove-AzPrivateDnsRecordSet cmdlet 从指定区域中删除指定的记录集。 不能删除在专用区域顶点自动创建的 SOA 记录。 可以使用管道运算符或参数或 ResourceId 将 RecordSet 对象传递给此 cmdlet。 若要在不使用 RecordSet 对象的情况下按名称和类型标识记录集,必须使用管道运算符或参数将区域作为 PSPrivateDnsZone 对象传递给此 cmdlet,或者也可以指定 ZoneName 和 ResourceGroupName 参数。 可以使用 Confirm 参数和 $ConfirmPreference Windows PowerShell 变量来控制 cmdlet 是否提示你进行确认。 使用 RecordSet 对象指定记录集时,如果在 Azure 专用 DNS 中更改了记录集,则不会删除记录集,因为检索了本地 RecordSet 对象。 这为并发更改提供保护。 可以使用 Overwrite 参数取消此作,无论并发更改如何,都会删除记录集。
示例
示例 1:删除记录集
$RecordSet = Get-AzPrivateDnsRecordSet -Name "www" -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com"
Remove-AzPrivateDnsRecordSet -RecordSet $RecordSet
第一个命令获取指定的记录集,然后将其存储在$RecordSet变量中。第二个命令删除$RecordSet中的记录集。
示例 2:删除记录集并取消所有确认
$RecordSet = Get-AzPrivateDnsRecordSet -Name "www" -ZoneName "myzone.com" -ResourceGroupName "MyResourceGroup"
Remove-AzPrivateDnsRecordSet -RecordSet $RecordSet -Confirm:$False -Overwrite
# Alternatively, the record set can be removed as follows. In this case,
# because the record set is specified by name rather than by object, the
# Overwrite parameter is not applicable.
Remove-AzPrivateDnsRecordSet -Name "www" -ZoneName "myzone.com" -ResourceGroupName "MyResourceGroup" -Confirm:$False
第一个命令获取指定的记录集。 第二个命令将删除记录集,即使记录集在此期间已更改也是如此。 确认提示将被取消。
参数
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Name
记录集中记录的名称(相对于区域的名称和没有终止点)。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Overwrite
请勿使用 RecordSet 参数的 ETag 字段进行乐观并发检查。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-PassThru
用于传递作的结果(布尔值),删除管道后面的专用区域。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-RecordSet
要在其中添加记录的记录集。
类型: | PSPrivateDnsRecordSet |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-RecordType
记录集中专用 DNS 记录的类型。
类型: | RecordType |
接受的值: | A, AAAA, CNAME, MX, PTR, SOA, SRV, TXT |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
区域所属的资源组。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceId
专用 DNS RecordSet ResourceID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Zone
表示在其中创建记录集的区域的 PrivateDnsZone 对象。
类型: | PSPrivateDnsZone |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ZoneName
记录集所在的区域(没有终止点)。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |