Microsoft.KnowledgeServices.Windows.HyperV.VirtualNetwork_Discovery

Microsoft.KnowledgeServices.Windows.HyperV.VirtualNetwork_Discovery (Discovery)

Discovery module for class Microsoft.KnowledgeServices.Windows.HyperV.VirtualNetwork

Element properties:

TargetMicrosoft.Windows.HyperV.VirtualNetwork
EnabledTrue
Frequency44090
RemotableFalse

Object Discovery Details:

Discovered Classes and their attribuets:

Member Modules:

ID Module Type TypeId RunAs 
Microsoft.KnowledgeServices.Windows.HyperV.VirtualNetwork_Discovery DataSource Microsoft.Windows.TimedPowerShell.DiscoveryProvider Default

Source Code:

<Discovery ID="Microsoft.KnowledgeServices.Windows.HyperV.VirtualNetwork_Discovery" Enabled="true" Target="MicrosoftWindowsHyperVLibrary!Microsoft.Windows.HyperV.VirtualNetwork" ConfirmDelivery="true" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="MicrosoftKnowledgeServicesWindowsHyperVLibrary!Microsoft.KnowledgeServices.Windows.HyperV.VirtualNetwork"/>
</DiscoveryTypes>
<DataSource ID="Microsoft.KnowledgeServices.Windows.HyperV.VirtualNetwork_Discovery" TypeID="Windows!Microsoft.Windows.TimedPowerShell.DiscoveryProvider">
<IntervalSeconds>44090</IntervalSeconds>
<SyncTime/>
<ScriptName>VirtualNetworkExtension.ps1</ScriptName>
<ScriptBody><Script>

param($SourceId,$ManagedEntityId,$KeyPropertyNetworkId,$KeyPropertyServerId,$KeyPropertyPrincipalName)

$ErrorActionPreference = "Stop"

# Set up the arguments
$scriptargs = new-object psobject
$scriptargs | add-member NoteProperty "SourceId" $SourceId
$scriptargs | add-member NoteProperty "ManagedEntityId" $ManagedEntityId
$scriptargs | add-member NoteProperty "KeyPropertyNetworkId" $KeyPropertyNetworkId
$scriptargs | add-member NoteProperty "KeyPropertyServerId" $KeyPropertyServerId
$scriptargs | add-member NoteProperty "KeyPropertyPrincipalName" $KeyPropertyPrincipalName

# Set up the discovery output
$discoveryoutput = new-object psobject

#-----------------------------------------------------
# Main Discovery Function
#-----------------------------------------------------
function AdvisorDiscovery($scriptargs, $discoveryoutput)
{
}


# Create a new discovery data packet
$oAPI = new-object -comObject "MOM.ScriptAPI"

$discoverydata = $oAPI.CreateDiscoveryData(0, $scriptargs.SourceId, $scriptargs.ManagedEntityId)
$instance = $discoverydata.CreateClassInstance("$MPElement[Name='MicrosoftKnowledgeServicesWindowsHyperVLibrary!Microsoft.KnowledgeServices.Windows.HyperV.VirtualNetwork']$")
$instance.AddProperty("$MPElement[Name='MicrosoftWindowsHyperVLibrary!Microsoft.Windows.HyperV.VirtualNetwork']/NetworkId$", $scriptargs.KeyPropertyNetworkId)
$instance.AddProperty("$MPElement[Name='MicrosoftWindowsHyperVLibrary!Microsoft.Windows.HyperV.ServerRole']/ServerId$", $scriptargs.KeyPropertyServerId)
$instance.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", $scriptargs.KeyPropertyPrincipalName)

AdvisorDiscovery $scriptargs $discoveryoutput

</Script></ScriptBody>
<Parameters>
<Parameter>
<Name>SourceId</Name>
<Value>$MPElement$</Value>
</Parameter>
<Parameter>
<Name>ManagedEntityId</Name>
<Value>$Target/Id$</Value>
</Parameter>
<Parameter>
<Name>KeyPropertyNetworkId</Name>
<Value>$Target/Property[Type="MicrosoftWindowsHyperVLibrary!Microsoft.Windows.HyperV.VirtualNetwork"]/NetworkId$</Value>
</Parameter>
<Parameter>
<Name>KeyPropertyServerId</Name>
<Value>$Target/Host/Property[Type="MicrosoftWindowsHyperVLibrary!Microsoft.Windows.HyperV.ServerRole"]/ServerId$</Value>
</Parameter>
<Parameter>
<Name>KeyPropertyPrincipalName</Name>
<Value>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>300</TimeoutSeconds>
<StrictErrorHandling>false</StrictErrorHandling>
</DataSource>
</Discovery>