This topic contains 4 replies, has 4 voices, and was last updated by
January 29, 2016 at 10:00 am #34570ParticipantTopics: 1Replies: 0Points: 0Rank: Member
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 #34573ParticipantTopics: 3Replies: 27Points: 0Rank: Member
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.
January 29, 2016 at 11:45 am #34574ParticipantTopics: 3Replies: 27Points: 0Rank: Member
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.
January 29, 2016 at 11:56 am #34575ParticipantTopics: 17Replies: 27Points: 47Rank: Member
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 #34582ParticipantTopics: 0Replies: 1Points: 0Rank: Member
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.
The topic ‘How to find DiskIndex of a Volume or Mount point using Powershell’ is closed to new replies.