- January 29, 2016 at 10:00 am #34570
I am using Win32_Volume wmi class to report the Mount points and drive letters and labels etc..
Get-WmiObject Win32_Volume | FT Caption,Label,FreeSpace,Capacity
How to add DiskIndex to my report?
I get DiskIndex using Win32_DiskPartition, but not able to map it with the result from my first command(Get-WmiObject Win32_Volume).
Get-WmiObject Win32_DiskPartition | FT DiskIndex
PS : I cannot use Win32_LogicalDisk class as it will not report the mount points..January 29, 2016 at 11:17 am #34573
Just to make sure I understand what you're trying to do. You want to get the physical disk number that a mount point is on, hence trying to match something from Win32_DiskPartition to something in Win32_Volume... so you can return the DiskIndex value from Win32_DiskPartition and make that part of your report along with the drive letter, path, etc...
Correct? If so, i'm trying to find something that could be used between the two classes that would be able to match to ensure you're getting correct data. But nothing is jumping out at me.
BrianJanuary 29, 2016 at 11:45 am #34574
Actually, It doesn't appear there is any WMI methods of matching physical disk to mount point. Someone wrote something to do it, but it's not using WMI to get the disk index. They wrote their own class and it requires powershell remoting in order to get the data.
BrianJanuary 29, 2016 at 11:56 am #34575
I know you can run "diskpart" in POSH and then execute the "list disk" command which will output the index numbers of all volumes on the host. You should be able to do the same with PS remoting.January 29, 2016 at 5:44 pm #34582
Thanks I will try Get-MountPointData Cmdlet and see if it works for me..
I think diskpart doesn't show the drive letters or the mount points information. It only shows the disk index.
You must be logged in to reply to this topic.