
Anonymous Community User asked a question.
Getting The remote Server returned an error: (400) Bad Request when trying to use New-SFClient with the -Credential parameter in ShareFile PowerShell Module
I have a script that creates a new .sfps file and connects to sharefile everyday. As of August 19th this functionality has broken. The command I use is $SFUserName = 'User@Company.com' $SFPassword = Get-Content \\\\server\\\\fileshare\\\\ShareFileCreds.txt | ConvertTo-SecureString $Credential = New-Object System.Management.Automation.PSCredential($SFUserName,$SFPassword) [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; New-SfClient -Name ((Join-Path $env:USERPROFILE 'Documents') + '\\\\Sharefile..sfps') -Account AccountName-Credential $Credential The password is application specific password that I created in my account that has 2 factor authentication. I am able to connect if I remove the -Credential parameter from New-SFClient but it popups the authentication to sharefile locally which I can't have when I'm scheduling this script to run. Again, this has worked since February when I created it orginially after enabling 2 factor authentication to my account but it all of a sudden broke as of August 19th.