Skip to content

Instantly share code, notes, and snippets.

@jstangroome
Created January 4, 2013 03:48
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jstangroome/4449741 to your computer and use it in GitHub Desktop.
Save jstangroome/4449741 to your computer and use it in GitHub Desktop.
How to use Set-DnsServerResourceRecord in the Windows Server 2012 DnsServer PowerShell module
$Record = Get-DnsServerResourceRecord -ZoneName mydomain.local -Name mail -RRType CName
$NewRecord = $Record.Clone()
$NewRecord.RecordData.HostNameAlias = 'smtp.mydomain.com'
Set-DnsServerResourceRecord -ZoneName mydomain.local -OldInputObject $Record -NewInputObject $NewRecord
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment