VMware Cloud Community
esxi1979
Expert
Expert

Get-IScsiHbaTarget -Address xxx -Type Send | Remove-IScsiHbaTarget



Hi,


I need to get rid off some old conf from some of the cluster & in that some host where iscsi settings exits.


I am talking about the - Configuration tab - storage adapter - software or hardware iscsi apterter - properties - dy discover/static discover/ netwrk conf ..


1. List it per server


2. Remove it


all i got when google is


Get-IScsiHbaTarget -Address xxx -Type Send | Remove-IScsiHbaTarget


Then i tried some  combinations but so desired result. Can someone pls give some scrtipt or cmd for this ?

0 Kudos
3 Replies
LucD
Leadership
Leadership

You can do this per ESXi in the following way

foreach($esx in Get-VMHost){

     foreach($hba in (Get-VMHostHba -VMHost $esx -Type iSCSI)){

          Get-iSCSI -IScsiHba $hba

     }

}

If you need to add Where-clauses or just the Remove-IScsi cmdlet, just pipe the result from the Get-IScsi cmdlet.

An alternative is to go the esxcli path.

You find the iSCSI commands under $esxcli.iscsi after you have done.

$esxcli = Get-EsxCli -VMHost $esx


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

0 Kudos
esxi1979
Expert
Expert



Thanks for responding LucD


Looks there is some syntax eror


ALso i would like to see the hostname & then the list of Target info ... above will just dump all in one .. can u pls re-check

0 Kudos
esxi1979
Expert
Expert

0 Kudos