Click to Rate and Give Feedback
MSDN
MSDN Library
Networking
Network Protocols
DNS WMI Provider
DNS WMI Classes
MicrosoftDNS_Zone
 CreateZone Method of the MicrosoftD...
CreateZone Method of the MicrosoftDNS_Zone Class

The CreateZone method creates a DNS zone.

Syntax

MOF
void CreateZone(
  [in]            string ZoneName,
  [in]            uint32 ZoneType,
  [in]            boolean DsIntegrated,
  [in, optional]  string DataFileName,
  [in, optional]  string IpAddr[],
  [in, optional]  string AdminEmailName,
  [out, ref]      MicrosoftDns_Zone &RR
);

Parameters

ZoneName [in]

String representing the name of the zone.

ZoneType [in]

Type of zone. Valid values are the following:

ValueMeaning
0

Primary zone.

1

Secondary zone.

2

Stub zone.

Windows Server 2003:  This zone type is introduced in Windows Server 2003.
3

Zone forwarder.

Windows Server 2003:  This zone type is introduced in Windows Server 2003.

 

DsIntegrated [in]

Indicates whether zone data is stored in the Active Directory or in files. If TRUE, the data is stored in the Active Directory; if FALSE, the data is stored in files.

DataFileName [in, optional]

Name of the data file associated with the zone.

IpAddr [in, optional]

IP address of the master DNS Server for the zone.

AdminEmailName [in, optional]

Email address of the administrator responsible for the zone.

RR [out]

RR of type MicrosoftDns_Zone.

Return Value

This method does not return a value.

Requirements

Minimum supported clientNone supported
Minimum supported serverWindows 2000 Server
MOFDnsprov.mof
Namespace\\.\Root\MicrosoftDNS

See Also

MicrosoftDNS_Zone
AgeAllRecords Method of the MicrosoftDNS_Zone Class
ChangeZoneType Method of the MicrosoftDNS_Zone Class
ForceRefresh Method of the MicrosoftDNS_Zone Class
GetDistinguishedName Method of the MicrosoftDNS_Zone Class
PauseZone Method of the MicrosoftDNS_Zone Class
ReloadZone Method of the MicrosoftDNS_Zone Class
ResetSecondaries Method of the MicrosoftDNS_Zone Class
ResumeZone Method of the MicrosoftDNS_Zone Class
UpdateFromDS Method of the MicrosoftDNS_Zone Class
WriteBackZone Method of the MicrosoftDNS_Zone Class

Send comments about this topic to Microsoft

Build date: 11/12/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Create zone using CreateZone method with PowerShell      Thomas Lee   |   Edit   |   Show History
# 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"
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker