Solved

How do I change the SOA record on a Server 2012 R2 Core box in my DMZ with Powershell?

Posted on 2014-04-17
2
1,524 Views
Last Modified: 2014-04-21
Hello Experts,

How do I change the SOA record on a Server 2012 R2 Core box in my DMZ with Powershell?

I tried doing this with the following dnscmd command:

Dnscmd dmzdns /recordadd mydomain.com . SOA ns1.mydomain.com dns-admin.mydomain.com
0
Comment
Question by:ndalmolin_13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 71

Accepted Solution

by:
Chris Dent earned 500 total points
ID: 40008518
2012 R2 comes with DNS CmdLets you know? The syntax is slightly arcane.
Import-Module DnsServer

# Get the record and hold it in two variables (old and new)
$OldSOARecord = $NewSOARecord = Get-DnsServerResourceRecord -ZoneName mydomain.com -RRType SOA
# Set the new values on the New record
# Note that you must include the trailing "." in the string. Tells DNS not to append the origin.
$NewSOARecord.RecordData.PrimaryServer = "ns1.mydomain.com."
$NewSOARecord.ResponsiblePerson = "dns-admin.mydomain.com."
# Commit the changes, referencing the old record, the new record and repeating the domain name.
Set-DnsServerResourceRecord -NewInputObject $NewSOARecord -OldInputObject $OldSOARecord -Zone "mydomain.com"

Open in new window

HTH

Chris
0
 
LVL 1

Author Closing Comment

by:ndalmolin_13
ID: 40012456
Chris,
Thanks for the info and the explaination.  It worked as expected.

Nick
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Synchronize a new Active Directory domain with an existing Office 365 tenant
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question