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,553 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

724 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