VMware Cloud Community
pamiller21
Enthusiast
Enthusiast
Jump to solution

Get iSCSI Initiator Name

Hey,

I am trying to get a script to pull the iSCSI initiator name, not finding much luck.

Any help is greatly appreciated. 

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You could do something like this

Get-VMHost -PipelineVariable esx |
ForEach-Object -Process {
    $storSys = Get-View -Id $esx.ExtensionData.ConfigManager.StorageSystem
    $storSys.StorageDeviceInfo.HostBusAdapter.where{$_ -is [VMware.Vim.HostInternetScsiHba]} |
    Select @{N='VMHost';E={$esx.Name}},
        Device,iScsiName
}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
1 Reply
LucD
Leadership
Leadership
Jump to solution

You could do something like this

Get-VMHost -PipelineVariable esx |
ForEach-Object -Process {
    $storSys = Get-View -Id $esx.ExtensionData.ConfigManager.StorageSystem
    $storSys.StorageDeviceInfo.HostBusAdapter.where{$_ -is [VMware.Vim.HostInternetScsiHba]} |
    Select @{N='VMHost';E={$esx.Name}},
        Device,iScsiName
}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos