Excellent! Thank you so much. This work-around is great. There were two things I had to change, but they were very very minor...you did all the heavy lifting. One of the variables was missing its $ before the string and the UNBOUND statement was in single quotes, but it needed to be in double quotes. Here's the final version of that section of the script with my little tweaks:
Enable software iSCSI on the host
Write-Host "Enabling the software iSCSI initiator" -ForegroundColor yellow -BackgroundColor Black
Get-VMHostStorage $ESXiHostIP | Set-VMHostStorage -SoftwareIScsiEnabled $true
Retrieve the iSCSI HBA(s) on the host
Write-Host "Retrieving the iSCSI HBA(s) on the host" -ForegroundColor yellow -BackgroundColor Black
#$iscsiHba = Get-VMHostHba -Type IScsi
$iscsiHba = (Get-VmHost $ESXiHostIP).StorageInfo.ExtensionData.StorageDeviceInfo.HostBusAdapter | where {$_.Model -like "iSCSI Software Adapter" -and $_.Status -notlike "unbound"}
$iscsivmhba = $iscsihba.device
Add a new iSCSI target for dynamic discovery (the default port number is 3260)
Write-Host "Adding an iSCSI target for dynamic discovery" -ForegroundColor yellow -BackgroundColor Black
#$iscsiHba | New-IScsiHbaTarget -Address $ESXiiSCSIgroupIP -Type Send
$targets = New-Object VMware.Vim.HostInternetScsiHbaSendTarget[] (1)
$targets[0] = New-Object VMware.Vim.HostInternetScsiHbaSendTarget
$targets[0].address = $ESXiiSCSIgroupIP
$targets[0].port = 3260
$hsView = Get-VMHostStorage $ESXiHostIP | Get-View
foreach($hba in $iscsiHba) {
$hsView.AddInternetScsiSendTargets($hba.Device, $targets)
}
Again, thank you very much!
-Dillon