PowerCLI – Retrieving VM Disk Controller Types

I have recently been auditing a client’s cloud infrastructure to looking for configuration difference between vCenters/PODs.

Here is a helpful little PowerCLI script to review all the Virtual SCSI Controllers for VM’s in your environment.

# Retrieving VM Disk Controller Types
# V1.0 by Christian Parker

# Set Variables
$POD = "vcenter.domain.local"
$Cluster1 = "Management"

# Connect to vSphere
Write-Host "Connecting to" $POD
Connect-VIServer $POD | Out-Null

# Retrieve VM Disk Controller Types
Write-Host "Collecting Virtual SCSI Controllers for" $POD
Get-VM -Location $Cluster1 | Select Name,@{N="Cluster";E={Get-Cluster -VM $_}},@{N="Controller Type";E={Get-ScsiController -VM $_ | Select -ExpandProperty Type}} | Export-Csv C:\Temp\vSCSI_Type.csv -NoTypeInformation

# Disconnect from vSphere
Disconnect-VIServer $POD -Force -confirm:$false

One Comment

  1. fann said:

    it works like a charm..great thanks and really appreciated it.

    3rd January 2017

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.