Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Disconnect-IscsiTarget insists on interactive mode..

$
0
0

Hi

I am trying to automate disconnecting using  Disconnect-IscsiTargetbut it insists on prompting me for confirmation. Not so good when you want to use this from Orchestrator.

The interaktiv behaviour:

PS C:\Users\Administrator\Desktop\hitkit> .\disconnect_eql_volume.ps1

Successfully connected to the group 'DELL-EQL-S3G-T05-GRP01'

Confirm

Are you sure you want to perform this action?

Performing operation '' on Target ''.

[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

The script:

#Dell part

Import-Module'C:\Program Files\EqualLogic\bin\EqlPSTools.dll'

Connect-EqlGroup-GroupAddress$groupAddress-GroupName$groupName-UserName$user-Password$password

$iTarget= (Get-EqlVolume-VolumeName$volumeName).ISCSITargetName

#Microsoft part

Disconnect-IscsiTarget-NodeAddress$iTarget

How may we run this command without user interaction?

I have tried this:

write-output'Y'| Disconnect-IscsiTarget-NodeAddress $iTarget-PassThru

but get this error:

Disconnect-IscsiTarget : The input object cannot be bound to any parameters for the command either because the command

does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.

I have also tried disconnecting all sessions beforehand inlcluding persistent connection.

I have also played with the –confirm switch for the  Disconnect-IscsiTarget  but it gives the same interactive behaviour. I would believe that with the –confirm switch, the default behavior would be non-interactive.

The disk is offline in Windows diskmanager and connected as a iscsitarget.

Best Regards,

Erik


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>