ShareFile-PowerShell icon indicating copy to clipboard operation
ShareFile-PowerShell copied to clipboard

New-SFClient Error: (400) Bad Request when using -Credential -Account

Open CoreyGouin opened this issue 5 years ago • 1 comments

Starting on 2/14/2020, the New-SFClient cmdlet has been failing with 400 Bad request error when using parameters -Credential. I tried to pass PSCredential object through either New-Object System.Management.Automation.PSCredential($UserName,$Password) or Get-Credential.
The command that is being run is. New-SfClient -Name ((Join-Path $env:USERPROFILE "Documents") + "\ShareFile.sfps") -Account CompanyName -Credential $Credential

The command works if I remove the -Credential parameter and uses the Popup web authentication to ShareFile.

CoreyGouin avatar Feb 18 '20 15:02 CoreyGouin

Do you pass your $Password as securestring? If not, please try:

$Credential = New-Object System.Management.Automation.PSCredential($UserName, ($Password | ConvertTo-SecureString -AsPlainText -Force))

adnkai avatar Jul 02 '20 07:07 adnkai