DnsServerName - property in ROOT\MicrosoftDNS namespace

DnsServerName in other namespaces

List of classes with DnsServerName local property in ROOT\MicrosoftDNS namespace

propertyClassOrigin
DnsServerNameMicrosoftDNS_DomainMicrosoftDNS_Domain
DnsServerNameMicrosoftDNS_ResourceRecordMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_StatisticMicrosoftDNS_Statistic

List of classes with DnsServerName derived property in ROOT\MicrosoftDNS namespace

propertyClassOrigin
DnsServerNameMicrosoftDNS_AAAATypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_AFSDBTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_ATMATypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_ATypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_CacheMicrosoftDNS_Domain
DnsServerNameMicrosoftDNS_CNAMETypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_HINFOTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_ISDNTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_KEYTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_MBTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_MDTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_MFTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_MGTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_MINFOTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_MRTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_MXTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_NSTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_NXTTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_PTRTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_RootHintsMicrosoftDNS_Domain
DnsServerNameMicrosoftDNS_RPTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_RTTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_SIGTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_SOATypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_SRVTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_TXTTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_WINSRTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_WINSTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_WKSTypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_X25TypeMicrosoftDNS_ResourceRecord
DnsServerNameMicrosoftDNS_ZoneMicrosoftDNS_Domain

Code samples for DnsServerName property

Get instance of WMI class using GetObject, DnsServerName property of MicrosoftDNS_Domain

Short VBS code - get a single specified instance of MicrosoftDNS_Domain class or get a default unnamed instance (singleton) of the class, using one single command GetObject with exact path of the wmi object.

'https://wutils.com/wmi/
Dim wmiObject
Set wmiObject = GetObject( _
 "WINMGMTS:\\.\ROOT\MicrosoftDNS:" + _
 "MicrosoftDNS_RootHints.ContainerName=""..RootHints"",DnsServerName=""..rootdomain.com"",Name=""..RootHints""")
Wscript.Echo wmiObject.DnsServerName 'or other property name, see properties
See more VBS samples of MicrosoftDNS_Domain class

WMI query - sample windows WQL with C#, DnsServerName property of MicrosoftDNS_Domain

Get a specified instance of MicrosoftDNS_Domain by a key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this c# sample code.
See in another language: VBScript, VB.Net.
//https://wutils.com/wmi/

//Project -> Add reference -> System.Management
//using System.Management;

//create a management scope object
ManagementScope scope = new ManagementScope("\\\\.\\ROOT\\MicrosoftDNS");

//create object query
ObjectQuery query = new ObjectQuery("SELECT * FROM MicrosoftDNS_Domain Where ContainerName=\"..RootHints\"DnsServerName=\"W2012SDC.rootdomain.com\"Name=\"..RootHints\"");

//create object searcher
ManagementObjectSearcher searcher =
                        new ManagementObjectSearcher(scope, query);

//get a collection of WMI objects
ManagementObjectCollection queryCollection = searcher.Get();

//enumerate the collection.
foreach (ManagementObject m in queryCollection) 
{
  // access properties of the WMI object
  Console.WriteLine("DnsServerName : {0}", m["DnsServerName"]);
  
}

WMI query - sample windows WQL with VB.Net, DnsServerName property of MicrosoftDNS_Domain

Get a specified instance of MicrosoftDNS_Domain by a key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this VB.Net sample code.
See in another language: VBScript, C#
'Project -> Add reference -> System.Management
'Imports System.Management

'Get the namespace management scope
Dim Scope As New ManagementScope("\\.\ROOT\MicrosoftDNS")

'Get a result of WML query 
Dim Query As New ObjectQuery("SELECT * FROM MicrosoftDNS_Domain Where ContainerName="..RootHints"DnsServerName="W2012SDC.rootdomain.com"Name="..RootHints"")

'Create object searcher
Dim Searcher As New ManagementObjectSearcher(Scope, Query)

'Get a collection of WMI objects
Dim queryCollection As ManagementObjectCollection = Searcher.Get

'Enumerate wmi object 
For Each mObject As ManagementObject In queryCollection
  'write out some property value
  Console.WriteLine("DnsServerName : {0}", mObject("DnsServerName"))
Next
comments powered by Disqus
WUtils.com