Microsoft Windows Server DNS WINS Discovery

Microsoft.Windows.Server.DNS.WINS.Discovery (Discovery)

Discovers WINS integrated zones

Knowledge Base article:

Summary

Discovers WINS integrated zones

Element properties:

TargetMicrosoft.Windows.Server.DNS.Zone
EnabledTrue
Frequency14760
RemotableFalse

Object Discovery Details:

Discovered Classes and their attribuets:

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.TimedScript.DiscoveryProvider Microsoft.Windows.Server.DNS.ActionAccount

Source Code:

<Discovery ID="Microsoft.Windows.Server.DNS.WINS.Discovery" Enabled="true" Target="Microsoft.Windows.Server.DNS.Zone" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="Microsoft.Windows.Server.DNS.Zone.WINSConnector">
<Property TypeID="Microsoft.Windows.Server.DNS.Zone.WINSConnector" PropertyID="IPAddress"/>
<Property TypeID="System!System.Entity" PropertyID="DisplayName"/>
</DiscoveryClass>
<DiscoveryClass TypeID="Microsoft.Windows.Server.DNS.Zone.WINSRConnector">
<Property TypeID="Microsoft.Windows.Server.DNS.Zone.WINSRConnector" PropertyID="ResultDomain"/>
<Property TypeID="System!System.Entity" PropertyID="DisplayName"/>
</DiscoveryClass>
</DiscoveryTypes>
<DataSource ID="DS" RunAs="Microsoft.Windows.Server.DNS.ActionAccount" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
<IntervalSeconds>14760</IntervalSeconds>
<SyncTime/>
<ScriptName>Microsoft.Windows.Server.DNS.WINS.Discovery.vbs</ScriptName>
<Arguments/>
<ScriptBody><Script>'Copyright (c) Microsoft Corporation. All rights reserved.

'*************************************************************************
' ScriptName: Microsoft.Windows.Server.DNS.WINS.Discovery
'
' Purpose: DNS Server WINS Discovery
'
' File: Microsoft.Windows.Server.DNS.WINS.Discovery.vbs
'*************************************************************************

Option Explicit

SetLocale("en-us")

Dim strSourceId, strManagedEntityId, strTargetComputer, strZoneName, wmiNamespaceString, wmiQueryString, junkVar
Dim boolIsReverse
Dim oAPI, oDiscoveryData, objWMIService, colitems, objItem, lInst

strSourceId = "$MPElement$"
strManagedEntityId = "$Target/Id$"
strTargetComputer = "$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$"
strZoneName = "$Target/Property[Type="Microsoft.Windows.Server.DNS.Zone"]/ZoneName$"
boolIsReverse = CBool("$Target/Property[Type="Microsoft.Windows.Server.DNS.Zone"]/IsReverseZone$")
wmiNamespaceString = "winmgmts://./root/MicrosoftDNS"

If boolIsReverse Then
wmiQueryString = "SELECT * FROM MicrosoftDNS_WINSRType WHERE DomainName = '" &amp; strZoneName &amp; "'"
Else
wmiQueryString = "SELECT * FROM MicrosoftDNS_WINSType WHERE DomainName = '" &amp; strZoneName &amp; "'"
End If

Set oAPI = CreateObject("MOM.ScriptAPI")
Set oDiscoveryData = oAPI.CreateDiscoveryData(0, strSourceId, strManagedEntityId)

ON ERROR RESUME NEXT

set objWMIService = GetObject(wmiNamespaceString)

If Err.Number &lt;&gt; 0 Then
Call ReturnDiscovery
End If

set colitems = objWMIService.ExecQuery(wmiQueryString)
junkVar = colitems.count

If Err.Number &lt;&gt; 0 Then
Call ReturnDiscovery
End If

If ( colitems.count = 0 ) Then
Call ReturnDiscovery
End If

For Each objItem In colitems

If boolIsReverse Then
Set lInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Windows.Server.DNS.Zone.WINSRConnector']$")
call lInst.AddProperty("$MPElement[Name='Microsoft.Windows.Server.DNS.Zone.WINSRConnector']/ResultDomain$", objItem.ResultDomain)
Else
Set lInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Windows.Server.DNS.Zone.WINSConnector']$")
call lInst.AddProperty("$MPElement[Name='Microsoft.Windows.Server.DNS.Zone.WINSConnector']/IPAddress$", objItem.WinsServers)
End If

call lInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", strTargetComputer)
call lInst.AddProperty("$MPElement[Name='Microsoft.Windows.Server.DNS.Server']/Name$", strTargetComputer)
call lInst.AddProperty("$MPElement[Name='Microsoft.Windows.Server.DNS.Zone']/ZoneName$", strZoneName)
call lInst.AddProperty("$MPElement[Name='Microsoft.Windows.Server.DNS.Zone']/HostName$", strTargetComputer)
Call oDiscoveryData.AddInstance(lInst)

Next

Call ReturnDiscovery



Sub ReturnDiscovery

Call oAPI.Return(oDiscoveryData)
WScript.Quit

End Sub</Script></ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
</DataSource>
</Discovery>