Hi all,
I am trying to run SSH commands on a filer but cannot make the credentials work with "Read-Host"
Here is what I am doing:
$lif = Read-Host "Please enter the node IP address (management LIF)"
$user = Read-Host "Please enter the username"
$pass = Read-Host -assecurestring "Please enter your password"
$password = ConvertTo-SecureString $pass -AsPlainText -Force
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $user,$password
Invoke-NcSsh -name $lif -command version -credential $cred
Here is what I am getting:
Invoke-NcSsh : User cannot be authenticated.
At C:\script.ps1:7 char:1
+ Invoke-NcSsh -name $lif -command version -credential $cred
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidResult: ( [Invoke-NcSsh], SshAuthenticationException
+ FullyQualifiedErrorId : SshExecFailed,DataONTAP.C.PowerShell.SDK.Cmdlets.Toolkit.Ssh.InvokeNcSsh
any ideas?