FTP Download PowerShell Script

Anonymous
2020-07-16T02:58:38.777+00:00

I am attempting to download a file from an ftp site, but am getting an error from the script:
12641-%E6%89%B9%E6%B3%A8-2020-07-16-105724.png
The error is:

Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (530) Not logged in."
At ps1:15 char:1

  • $FTPResponse = $FTPRequest.GetResponse()
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
  • FullyQualifiedErrorId : WebException

Any help would be greatly appreciated.

Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Young Yang (Shanghai Wicresoft Co,.Ltd.) 661 Reputation points
    2020-07-16T06:01:46.583+00:00

    Hi,

    From the Error message: The remote server returned an error: (530) Not logged in.

    I recommend checking the username and password very carefully. In many ftp servers, the username and password are case sensitive.

    Please let us know if you would like further assistance.

    Best wishes.

    Young Yang

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. رويدة احمد محمد حمامرة 1 Reputation point
    2021-07-08T08:43:03.977+00:00

    .Requesting a Cloud Shell.Succeeded.
    Connecting terminal...

    Welcome to Azure Cloud Shell

    Type "az" to use Azure CLI
    Type "help" to learn about Cloud Shell

    azureuser@Azure:

    0 comments No comments

  2. Purna Rao 26 Reputation points
    2021-11-11T18:12:01.447+00:00

    @Anonymous - You need to convert password to secure string before creating credential object like below

    $Secpwd = ConvertTo-SecureString $password -AsPlainText -Force  
    $FTPRequest.Credentials = New-Object System.Net.NetworkCredential($UserName,$Secpwd)  
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.