'Which cmdlet to use for creating a domain (folder) under a Primary Zone on the DNS-server?
As the below picture shows, I want to use a PowerShell cmdlet to create/delete domains (folders) under a primary zone in the Windows DNS Server. I've have not been able to figure out which DNSServer cmdlet to use ref. docs.microsoft.com
As the picture below shows I have manually created "sandkasse.no" (sandbox), and added using the GUI "dev.sandkasse.no", "prodfix.sandkasse.no" etc. But not yet figured out which cmdlet that will create yet another one for me.
Win 2016
Solution 1:[1]
I just figured it out. If you check your zone with the following command, you can see, that the records in the "New Domains" in the GUI are just shown as normal records with a "." in between (like sandkasse.no)
Get-DnsServerResourceRecord -ZoneName "contoso.com"
Actually, if you just add a "DnsServerResourceRecord" like shown below with a Name "test.test" it will show up in the GUI like a "New Domain" (In my case I created a CNAME "test.test").
Add-DnsServerResourceRecord -CName -Name "test.test" -HostNameAlias "Host34.lab.contoso.com" -ZoneName "Contoso.com"
Resources to lookup
German: administrator.de: Powershell DNS neue Domain anlegen
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | HeyThereSmile |