Remove-IscsiVirtualDiskTargetMapping
Removes the assignment between the specified iSCSI virtual disk and the specified iSCSI target.
Syntax
Default (Default)
Remove-IscsiVirtualDiskTargetMapping
[-TargetName] <String>
[-Path] <String>
[-ComputerName <String>]
[-Credential <PSCredential>]
[<CommonParameters>]
Description
The Remove-IscsiVirtualDiskTargetMapping cmdlet removes the assignment between a virtual disk and an iSCSI target. The virtual disk is no longer accessible by an iSCSI initiator after the assignment is removed.
Examples
Example 1: Disassociates a virtual disk from a target
PS C:\> Remove-IscsiVirtualDiskTargetMapping -TargetName "TargetOne" -Path "E:\temp\vhd1.vhdx"
This example un-assigns, or disassociates, the virtual disk at E:\temp\vhd1.vhdx from the target named TargetOne. Use Add-IscsiVirtualDiskTargetMapping to assign the virtual disk to an iSCSI target before it can be used by an iSCSI initiator.
Parameters
-ComputerName
Specifies the computer name, or IP address, of the remote computer, if this cmdlet is run on a remote computer.
Specifies the cluster resource group network name, or cluster node name, if this cmdlet is run on a cluster configuration.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-Credential
Specifies the credentials when connecting to a remote computer.
Parameter properties
| Type: | PSCredential |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-Path
Specifies the path of the virtual hard disk (VHD) file that is associated with the iSCSI virtual disk. Filter the iSCSI Virtual Disk object by using this parameter.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | DevicePath |
Parameter sets
(All)
| Position: | 1 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-TargetName
Specifies the name of the iSCSI target.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 0 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.