如何获取以枚举的磁盘开头的磁盘驱动器的内存映射设备地址
PS C:\WINDOWS\system32> gwmi Win32_DiskDrive | fl *
我可以用
PS C:\WINDOWS\system32> gwmi Win32_DeviceMemoryAddress | fl *
该命令列出了内存映射设备地址,但我没有看到任何与 Win32_DiskDrive 重叠的内容。
是的,我是 gwmi 新手。我知道基础知识,所以也许可行。
如何获取特定磁盘驱动器的内存映射设备地址,例如:
PSComputerName : JMR-ENG-SARAH
ConfigManagerErrorCode : 0
LastErrorCode :
NeedsCleaning :
Status : OK
DeviceID : \\.\PHYSICALDRIVE1
StatusInfo :
Partitions : 2
BytesPerSector : 512
ConfigManagerUserConfig : False
DefaultBlockSize :
Index : 1
InstallDate :
InterfaceType : SCSI
MaxBlockSize :
MaxMediaSize :
MinBlockSize :
NumberOfMediaSupported :
SectorsPerTrack : 63
Size : 512105932800
TotalCylinders : 62260
TotalHeads : 255
TotalSectors : 1000206900
TotalTracks : 15876300
TracksPerCylinder : 255
__GENUS : 2
__CLASS : Win32_DiskDrive
__SUPERCLASS : CIM_DiskDrive
__DYNASTY : CIM_ManagedSystemElement
__RELPATH : Win32_DiskDrive.DeviceID="\\\\.\\PHYSICALDRIVE1"
__PROPERTY_COUNT : 51
__DERIVATION : {CIM_DiskDrive, CIM_MediaAccessDevice, CIM_LogicalDevice, CIM_LogicalElement...}
__SERVER : JMR-ENG-SARAH
__NAMESPACE : root\cimv2
__PATH : \\JMR-ENG-SARAH\root\cimv2:Win32_DiskDrive.DeviceID="\\\\.\\PHYSICALDRIVE1"
Availability :
Capabilities : {3, 4}
CapabilityDescriptions : {Random Access, Supports Writing}
Caption : Samsung SSD 960 PRO 512GB
CompressionMethod :
CreationClassName : Win32_DiskDrive
Description : Disk drive
ErrorCleared :
ErrorDescription :
ErrorMethodology :
FirmwareRevision : 1B6QCXP7
Manufacturer : (Standard disk drives)
MediaLoaded : True
MediaType : Fixed hard disk media
Model : Samsung SSD 960 PRO 512GB
Name : \\.\PHYSICALDRIVE1
PNPDeviceID : SCSI\DISK&VEN_NVME&PROD_SAMSUNG_SSD_960\7&11BF5A6C&0&000000
PowerManagementCapabilities :
PowerManagementSupported :
SCSIBus : 0
SCSILogicalUnit : 0
SCSIPort : 1
SCSITargetId : 0
SerialNumber : 0025_385C_6150_0AD4.
Signature :
SystemCreationClassName : Win32_ComputerSystem
SystemName : JMR-ENG-SARAH
Scope : System.Management.ManagementScope
Path : \\JMR-ENG-SARAH\root\cimv2:Win32_DiskDrive.DeviceID="\\\\.\\PHYSICALDRIVE1"
Options : System.Management.ObjectGetOptions
ClassPath : \\JMR-ENG-SARAH\root\cimv2:Win32_DiskDrive
Properties : {Availability, BytesPerSector, Capabilities, CapabilityDescriptions...}
SystemProperties : {__GENUS, __CLASS, __SUPERCLASS, __DYNASTY...}
Qualifiers : {dynamic, Locale, provider, UUID}
Site :
Container :
以下是 的示例输出Win32_DeivceMemoryAddress
:
PSComputerName : JMR-ENG-SARAH
Status : OK
Name : 0xF7400000-0xF76FFFFF
MemoryType : WindowDecode
__GENUS : 2
__CLASS : Win32_DeviceMemoryAddress
__SUPERCLASS : Win32_SystemMemoryResource
__DYNASTY : CIM_ManagedSystemElement
__RELPATH : Win32_DeviceMemoryAddress.StartingAddress="4148166656"
__PROPERTY_COUNT : 11
__DERIVATION : {Win32_SystemMemoryResource, CIM_MemoryMappedIO, CIM_SystemResource, CIM_LogicalElement...}
__SERVER : JMR-ENG-SARAH
__NAMESPACE : root\cimv2
__PATH : \\JMR-ENG-SARAH\root\cimv2:Win32_DeviceMemoryAddress.StartingAddress="4148166656"
Caption : 0xF7400000-0xF76FFFFF
CreationClassName : Win32_DeviceMemoryAddress
CSCreationClassName : Win32_ComputerSystem
CSName : JMR-ENG-SARAH
Description : 0xF7400000-0xF76FFFFF
EndingAddress : 4151312383
InstallDate :
StartingAddress : 4148166656
Scope : System.Management.ManagementScope
Path : \\JMR-ENG-SARAH\root\cimv2:Win32_DeviceMemoryAddress.StartingAddress="4148166656"
Options : System.Management.ObjectGetOptions
ClassPath : \\JMR-ENG-SARAH\root\cimv2:Win32_DeviceMemoryAddress
Properties : {Caption, CreationClassName, CSCreationClassName, CSName...}
SystemProperties : {__GENUS, __CLASS, __SUPERCLASS, __DYNASTY...}
Qualifiers : {dynamic, Locale, provider, UUID}
Site :
Container :
我发现本网站,它提供了可用的 WMI Win32_* 标签列表以及 CIM 标签列表。
WMI 命令是什么以及如何从 Win32_DiskDrive 驱动器获取信息?
更新: 截至本文,Windows 处理 NVMe SSD 的方式与处理常规 SSD 的方式不同。因此,IDE 控制器和 WMI 列举的许多其他功能要么错误,要么不起作用。
答案1
我不是 WMI 专家,也不确定我在这里是否走在正确的轨道上。
Associators Of
但是WQL 语言(WMI 的 SQL)中 有一个关键字。Associators Of
允许您检索与特定源实例相关联的所有实例。因此,通过反复试验的方法,我将其缩小到以下命令:
Get-WmiObject -Query "ASSOCIATORS OF {Win32_DiskDrive.DeviceID='\\.\PHYSICALDRIVE0'} WHERE ResultClass=Win32_PnPEntity"
Get-WmiObject -Query "ASSOCIATORS OF {Win32_PnPEntity.DeviceID='SCSI\DISK&VEN_&PROD_KINGSTON_SHSS37A\4&2B0C446D&0&040000'} WHERE ResultClass=Win32_IdeController"
Get-WmiObject -Query "ASSOCIATORS OF {Win32_IDEController.DeviceID='PCI\VEN_8086&DEV_8C03&SUBSYS_397817AA&REV_05\3&11583659&0&FA'} WHERE ResultClass=Win32_DeviceMemoryAddress"
DeviceID
属性是硬编码的,并通过管道输出找到fl *
(以进一步检查返回的对象)
Associators Of
您还可以尝试使用关键字、Get-WMIObject -List
命令或 GUI Explorer进一步探索 WMI repo ,例如WMI 资源管理器