# Create-DNSZone.ps1
# Uses WMI's CreateZone Method of MicrosoftDNS_Zone to create a zone with PowerShell
# thomas lee - tfl@psp.co.uk
# first, point to our DNS server
$dnsserver=[wmiclass]"\\.\ROOT\Microsoftdns:Microsoftdns_zone"
# Now create the zone
$dnsserver.createzone("cookham.net",0,$true,"","","tfl@psp.co.uk")
When run on my Windows 2008 Server, produces the following output:
PS C:\foo> .\create-dnszone.ps1
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
RR : MicrosoftDNS_Zone.ContainerName="cookham.net",DnsServerName=".",Name="cookham.net"