发现 Windows 磁盘分区

Microsoft.Windows.Server.10.0.DiskPartition.Discovery (Discovery)

此规则使用 WMI 发现 Windows Server 2016 及更高版本操作系统的所有磁盘分区。

Knowledge Base article:

摘要

此发现规则可发现名为“Windows Server 2016 及更高版本磁盘分区”的 Windows Server 类,并使用在 Windows Server 2016 及更高版本操作系统上发现的磁盘分区的实例来填充它。

Element properties:

TargetMicrosoft.Windows.Server.10.0.OperatingSystem
EnabledFalse
Frequency86700
RemotableFalse

Object Discovery Details:

Discovered Classes and their attribuets:
Discovered relationships and their attribuets:

Member Modules:

ID Module Type TypeId RunAs 
DiscoveryDataSource DataSource Microsoft.Windows.WmiProviderWithClassSnapshotDataMapper Default

Source Code:

<Discovery ID="Microsoft.Windows.Server.10.0.DiskPartition.Discovery" Enabled="false" Target="Microsoft.Windows.Server.10.0.OperatingSystem">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="Microsoft.Windows.Server.10.0.DiskPartition">
<Property TypeID="Windows!Microsoft.Windows.LogicalDevice" PropertyID="DeviceID"/>
<Property TypeID="Windows!Microsoft.Windows.LogicalDevice" PropertyID="Name"/>
<Property TypeID="Windows!Microsoft.Windows.LogicalDevice" PropertyID="Description"/>
<Property TypeID="WindowsServer!Microsoft.Windows.Server.DiskPartition" PropertyID="DiskIndex"/>
<Property TypeID="WindowsServer!Microsoft.Windows.Server.DiskPartition" PropertyID="BlockSize"/>
<Property TypeID="WindowsServer!Microsoft.Windows.Server.DiskPartition" PropertyID="PrimaryPartition"/>
<Property TypeID="WindowsServer!Microsoft.Windows.Server.DiskPartition" PropertyID="Bootable"/>
<Property TypeID="WindowsServer!Microsoft.Windows.Server.DiskPartition" PropertyID="Size"/>
</DiscoveryClass>
<DiscoveryRelationship TypeID="Windows!Microsoft.Windows.ComputerHostsLogicalDevice"/>
</DiscoveryTypes>
<DataSource ID="DiscoveryDataSource" TypeID="Windows!Microsoft.Windows.WmiProviderWithClassSnapshotDataMapper">
<NameSpace>\\$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$\root\cimv2</NameSpace>
<Query>SELECT DeviceID, Name, DiskIndex, BlockSize, Description, PrimaryPartition, BootPartition, Size FROM Win32_DiskPartition</Query>
<Frequency>86700</Frequency>
<ClassId>$MPElement[Name="Microsoft.Windows.Server.10.0.DiskPartition"]$</ClassId>
<InstanceSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
<Value>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="Windows!Microsoft.Windows.LogicalDevice"]/DeviceID$</Name>
<Value>$Data/Property[@Name='DeviceID']$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="Windows!Microsoft.Windows.LogicalDevice"]/Name$</Name>
<Value>$Data/Property[@Name='Name']$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="WindowsServer!Microsoft.Windows.Server.DiskPartition"]/DiskIndex$</Name>
<Value>$Data/Property[@Name='DiskIndex']$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="WindowsServer!Microsoft.Windows.Server.DiskPartition"]/BlockSize$</Name>
<Value>$Data/Property[@Name='BlockSize']$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="Windows!Microsoft.Windows.LogicalDevice"]/Description$</Name>
<Value>$Data/Property[@Name='Description']$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="WindowsServer!Microsoft.Windows.Server.DiskPartition"]/PrimaryPartition$</Name>
<Value>$Data/Property[@Name='PrimaryPartition']$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="WindowsServer!Microsoft.Windows.Server.DiskPartition"]/Bootable$</Name>
<Value>$Data/Property[@Name='BootPartition']$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="WindowsServer!Microsoft.Windows.Server.DiskPartition"]/Size$</Name>
<Value>$Data/Property[@Name='Size']$</Value>
</Setting>
</Settings>
</InstanceSettings>
</DataSource>
</Discovery>