Remove an iSCSI Target Portal with PowerShell

I ran into a small problem with removing iSCSI Target Portals using PowerShell the other day and thought it might be worth documenting.

Pretend you have an iSCSI Target Portal configured with a Target Portal Address of 192.168.129.24:

ss_iscsi_gettargetportal

You might therefore expect that you could remove this Target Portal with the command:

Unfortunately this won’t work:

ss_iscsi_removetargetportal1

And neither does this:

ss_iscsi_removetargetportal2

What you actually have to do is specify both the Target Portal Address and the Initiator Portal Address when deleting an iSCSI Target Portal:

ss_iscsi_removetargetportalcorrect

Over and out.

 

2 thoughts on “Remove an iSCSI Target Portal with PowerShell

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s