Condividi tramite


Remove-IscsiServerTarget

Remove-IscsiServerTarget

Deletes the specified iSCSI target.

Syntax

Parameter Set: TargetName
Remove-IscsiServerTarget [-TargetName] <String> [ <CommonParameters>]

Parameter Set: __AllParameterSets
Remove-IscsiServerTarget [-ComputerName <String> ] [-Credential <PSCredential> ] [ <CommonParameters>]

Parameter Set: InputObject
Remove-IscsiServerTarget -InputObject <IscsiServerTarget> [ <CommonParameters>]

Detailed Description

The Remove-IscsiServerTarget cmdlet deletes an iSCSI Target object. An iSCSI initiator cannot access the virtual disk after the target is deleted.

Parameters

-ComputerName<String>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Credential<PSCredential>

Specifies the credentials when connecting to a remote computer.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InputObject<IscsiServerTarget>

Accepts an iSCSI Target object from the input pipeline.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TargetName<String>

Specifies the name of the iSCSI target.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • Microsoft.Iscsi.Target.Commands.IscsiServerTarget

Outputs

The output type is the type of the objects that the cmdlet emits.

  • None

Examples

EXAMPLE 1

This example deletes the target named TargetOne on the local server.

PS C:\> Remove-IscsiServerTarget –Targetname "TargetOne"

EXAMPLE 2

The example deletes all of the targets on the local server.

PS C:\> $all = Get-IscsiServerTarget
PS C:\> ForEach-Object –InputObject ($each in $all) –Process {Remove-IscsiServerTarget -InputObject $each}

ForEach-Object

Get-IscsiServerTarget

New-IscsiServerTarget

Set-IscsiServerTarget