< Back

Remove-AzureRmDnsRecordSet

Tue Jan 29, 2019 9:46 pm

NAME Remove-AzureRmDnsRecordSet



SYNOPSIS

Deletes a record set.





SYNTAX

Remove-AzureRmDnsRecordSet [-DefaultProfile <IAzureContextContainer>] [-Force] -Name <String> [-PassThru] -RecordType {A | AAAA | CAA | CNAME | MX

| NS | PTR | SOA | SRV | TXT} -ResourceGroupName <String> -ZoneName <String> [-Confirm] [-WhatIf] [<CommonParameters>]



Remove-AzureRmDnsRecordSet [-DefaultProfile <IAzureContextContainer>] [-Force] -Name <String> [-PassThru] -RecordType {A | AAAA | CAA | CNAME | MX

| NS | PTR | SOA | SRV | TXT} -Zone <DnsZone> [-Confirm] [-WhatIf] [<CommonParameters>]



Remove-AzureRmDnsRecordSet [-DefaultProfile <IAzureContextContainer>] [-Force] [-Overwrite] [-PassThru] -RecordSet <DnsRecordSet> [-Confirm]

[-WhatIf] [<CommonParameters>]





DESCRIPTION

The Remove-AzureRmDnsRecordSet cmdlet deletes the specified record set from the specified zone. You cannot delete SOA or name server (NS) records

that are automatically created at the zone apex.



You can pass a RecordSet object to this cmdlet by using the pipeline operator or as a parameter. To identify a record set by name and type without

using a RecordSet object, you must pass the zone as a DnsZone object to this cmdlet by using the pipeline operator or as a parameter, or

alternatively you can specify the ZoneName and ResourceGroupName parameters.



You can use the Confirm parameter and $ConfirmPreference Windows PowerShell variable to control whether the cmdlet prompts you for confirmation.



When specifying the record set using a RecordSet object, the record set is not deleted if it has been changed in Azure DNS since the local

RecordSet object was retrieved. This provides protection for concurrent changes. You can suppress this by using the Overwrite parameter, which

deletes the record set regardless of concurrent changes.





PARAMETERS

-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Force [<SwitchParameter>]

This parameter is deprecated for this cmdlet. It will be removed in a future release.



To control whether this cmdlet prompts you for confirmation, use the Confirm parameter.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies the name of the RecordSet to remove. When specifying the record set by name, the DNS zone must be specified using either the Zone

parameter or the ZoneName and ResourceGroupName parameters.



Alternatively, the record set can be specified using a RecordSet object, passed using the RecordSet parameter.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Overwrite [<SwitchParameter>]

When specifying the record set using a RecordSet object, the record set is not deleted if it has been changed in Azure DNS since the local

RecordSet object was retrieved. This provides protection for concurrent changes. This can be suppressed using the Overwrite parameter, which

deletes the record set regardless of concurrent changes.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-PassThru [<SwitchParameter>]

passthru



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-RecordSet <DnsRecordSet>

Specifies the RecordSet object to remove.



Alternatively, the record set can be specified using the Name and Zone parameters, or using the Name , ZoneName , and ResourceGroupName

parameters.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-RecordType <RecordType>

Specifies the type of DNS record.



Valid values are:



- A



- AAAA



- CNAME



- MX



- NS



- PTR



- SRV



- TXT





SOA records are deleted automatically when the zone is deleted. You cannot manually delete SOA records.





Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the resource group that contains the DNS zone that contains the RecordSet to delete. This parameter is applicable only when the

record set and DNS zone are specified using the Name and ZoneName parameters.



Alternatively, you can specify the record set using either the RecordSet parameter, or the Name and Zone parameters.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Zone <DnsZone>

Specifies the DNS zone that contains the RecordSet to delete. This parameter is applicable only when specifying the record set using the Name

parameter.



Alternatively, you can specify the record set using either the RecordSet parameter, or the Name , ZoneName , and ResourceGroupName parameters.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-ZoneName <String>

Specifies the name of the zone that contains the RecordSet to delete. You must also specify the Name and ResourceGroupName parameters.



Alternatively, the record set can be specified using either the RecordSet parameter, or the Name and Zone parameters.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

Microsoft.Azure.Commands.Dns.DnsRecordSet

You can pipe a RecordSet object to this cmdlet.





OUTPUTS

None

This cmdlet does not generate any output.





NOTES





You can use the Confirm parameter to control whether this cmdlet prompts you for confirmation. By default, the cmdlet prompts you for

confirmation if the $ConfirmPreference Windows PowerShell variable has a value of Medium or lower.



If you specify Confirm or Confirm:$True , this cmdlet prompts you for confirmation before it runs. If you specify Confirm:$False , the cmdlet

does not prompt you for confirmation.



Example 1: Remove a record set



PS C:\\> $RecordSet = Get-AzureRmDnsRecordSet -Name "www" -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com"

PS C:\\> Remove-AzureRmDnsRecordSet -RecordSet $RecordSet



The first command gets the specified record set, and then stores it in the $RecordSet variable.The second command removes the record set in

$RecordSet.





Example 2: Remove a record set and suppress all confirmation



PS C:\\> $RecordSet = Get-AzureRmDnsRecordSet -Name "www" -ZoneName "myzone.com" -ResourceGroupName "MyResourceGroup"

PS C:\\> Remove-AzureRmDnsRecordSet -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.



PS C:\\> Remove-AzureRmDnsRecordSet -Name "www" -ZoneName "myzone.com" -ResourceGroupName "MyResourceGroup" -Confirm:$False



The first command gets the specified record set.



The second command deletes the record set, even if it has changed in the meantime. Confirmation prompts are suppressed.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... srecordset

Get-AzureRmDnsRecordSet

New-AzureRmDnsRecordSet

Set-AzureRmDnsRecordSet