1

could you please help me how to get disk location number which can be found via Disk Management (diskmgmt.msc) for future VMware SCSI Disk devices assosciation via PowerShell or any other native scripting language from Microsoft?

Example:

Example of disk location

From Powershell I'm able to get only proper SCSITargetId which corresponds with VMware SCSI UnitNumber.

Example:

Get-WmiObject -Class Win32_DiskDrive | Select *
...
SCSIBus                     : 0
SCSILogicalUnit             : 0
SCSIPort                    : 2
SCSITargetId                : 0
...

But no mention about Location.

I want to make calculator based on Location and SCSITargetId which correspond with VMware SCSI controller (BusNumber:UnitNuber). Where Location 160 = SCSI Bus 0, Location 192 = SCSI Bus 1, etc. +32 every other assigned SCSI Bus.

VMware SCSI Controller disk location

Thank you for any help!

MyKE
  • 301
  • 2
  • 9

1 Answers1

1

Try to use use following command:

Get-PhysicalDisk | foreach {$_.PhysicalLocation}

The output will be SCSI0/SCSI1 depends from the SCSI controller in the VMware.

batistuta09
  • 8,981
  • 10
  • 23
  • This works for me only on WS2016, but not on WS2012R2 VMware SCSI disks. Is there any other way how to achive via WMI/CIM? And compatible at least with PS3.0? – MyKE Sep 07 '18 at 12:43