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,479 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
2 Comments
 
LVL 70

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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 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