PowerTip: Disconnect sessions to ISCSI target with PowerShell


Summary: Learn how to disconnect sessions to a specified ISCSI target with Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to disconnect sessions to a ISCSI target object?

Hey, Scripting Guy! Answer Use the Get-ISCSITarget cmdlet to retrieve the target, and then supply it as a node address for Disconnect-ISCSITarget, for example:

Get-IscsiTarget
$Tar = Get-IscsiTarget
Disconnect-IscsiTarget -NodeAddress $Tar.NodeAddress

Comments (0)

Skip to main content