Query pass-through disk properties (size, file name / location) by powershell

László Palkó 96 Reputation points
2021-02-04T14:49:24.17+00:00

Hi Gurus,

I have to query all of our vm's virtual disk properties from SCVMM. Everything working properly with normal virtual disks via Get-SCVirtualDiskDrive and Get-SCVirtualHardDisk cmdlets, however I cannot find details for pass-through disk, because there is no VirtualHarDiskID property of that type of object.
I'm pretty sure those has to be in database, because I can find on console under VM hardware properties....

We manage both HyperV and VMWare host by SCVMM.

Would you please give me some light?

Thanks,

Laszlo

System Center Virtual Machine Manager
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,381 questions
0 comments No comments
{count} votes

Accepted answer
  1. László Palkó 96 Reputation points
    2021-02-04T15:34:59.24+00:00

    ... and I got it:

    Get-SCStorageDisk -VMHost my_host | Where-Object {$_.Name -eq "my_passthroughdisk"}

    and this object has Capacity and Location property

    ... my_passthroughdisk coming from (Get-SCVirtualDiskDrive).PassThroughDisk

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Rich Matheisen 45,091 Reputation points
    2021-02-04T15:30:55.077+00:00

    Does this work?

    Get-VM -ComputerName <ClusterNode> | Get-VMHardDiskDrive | Where Path -like "Disk*"