This script was built to be able to create and update DNS records in a Microsoft DNS environment. Because there is no native PowerShell CmdLet for updating DNS records I make use of the DNSCMD command line tool and use PowerShell to parse my input file and pass the parameters to the command.

WARNING: This script will delete and re-create your DNS records. It does not hae a -WhatIf option so you MUST test it first in a test environment.

I've detailed the usage of the script in a blog post here: http://www.discoposse.com/index.php/2012/05/15/microsoft-dns-record-updates-using-powershell-and-dnscmd/ 

PowerShell
Edit|Remove
# Environment Setup 
$DNSServer = "YourDNSServer" 
$DNSZone = "YourZoneName" 
$InputFile = "dnsrecords.csv" 
 
# Read the input file which is formatted as name,type,address with a header row 
$records = Import-CSV $InputFile 
 
# Now we loop through the file to delete and re-create records 
# DNSCMD does not have a modify option so we must use /RecordDelete first followed by a /RecordAdd  
 
ForEach ($record in $records) { 
 
    # Capture the record contents as variables 
    $recordName = $record.name 
    $recordType = $record.type 
    $recordAddress = $record.address 
 
    # Build our DNSCMD DELETE command syntax 
    $cmdDelete = "dnscmd $DNSServer /RecordDelete $DNSZone $recordName $recordType /f" 
 
    # Build our DNSCMD ADD command syntax 
    $cmdAdd = "dnscmd $DNSServer /RecordAdd $DNSZone $recordName $recordType $recordAddress" 
 
    # Now we execute the command 
    Write-Host "Running the following command: $cmdDelete" 
    Invoke-Expression $cmdDelete 
 
    Write-Host "Running the following command: $cmdAdd" 
    Invoke-Expression $cmdAdd 
}