Giter VIP home page Giter VIP logo

pssubnetscan's People

Contributors

mgajda83 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

pssubnetscan's Issues

Can't find PSFTP repository to report.

I apologize for that writing here.
But can't find a repository for the PSFTP module or any way to report.

Duplicate from the StackOverflow:

I want to download some folders and files from another server via FTP using Powershell PSFTP module.

Following this answer I wrote the next script:

$User = "xxxxx"
$Password = ConvertTo-SecureString "xxxx" -AsPlainText -Force
$Credentials = New-Object System.Management.Automation.PSCredential ($User, $Password)

$ftp_server = "ftp://backup.xxxxx.eu"
$ftp_path = "backup_old/xxx/xx_Config_Backup"
$local_path = "D:\Backup\backup_old\xxx"

Set-FTPConnection -Credentials $Credentials -Server $ftp_server -EnableSsl -ignoreCert -UsePassive
Get-FTPChildItem -path $ftp_path -Recurse | Get-FTPItem -localpath $local_path -Overwrite -Verbose #-RecreateFolders 

This script works fine when ftp_path's folder consists of just files.

ContentLength           : -1
Headers                 : {}
SupportsHeaders         : True
ResponseUri             : ftp://backup.xxxxx.eu/
StatusCode              : ClosingData
StatusDescription       : 226 Transfer complete.
                          
LastModified            : 01.01.0001 0:00:00
BannerMessage           : 220 Microsoft FTP Service
                          
WelcomeMessage          : 230 User logged in.
                          
ExitMessage             : 221 Goodbye.
                          
IsFromCache             : False
IsMutuallyAuthenticated : False
ContentType             : 

VERBOSE: Performing the operation "Download item: 'ftp://backup.xxxxx.eu
/backup_old/xxx/QlikView/xxx.qvw'" on target "".
226 Transfer complete.

VERBOSE: Performing the operation "Download item: 'ftp://backup.xxxxx.eu
/backup_old/xxx/QlikView/xxxFulFillment.qvw'" on target "D:\Backup\backu
p_old\xxx\xxx.qvw".
226 Transfer complete.

But when it consists of additional folders with files, it creates a file with zero-size named same as folder and crashes with 550 error.

ContentLength           : -1
Headers                 : {}
SupportsHeaders         : True
ResponseUri             : ftp://backup.xxxxx.eu/
StatusCode              : ClosingData
StatusDescription       : 226 Transfer complete.
                          
LastModified            : 01.01.0001 0:00:00
BannerMessage           : 220 Microsoft FTP Service
                          
WelcomeMessage          : 230 User logged in.
                          
ExitMessage             : 221 Goodbye.
                          
IsFromCache             : False
IsMutuallyAuthenticated : False
ContentType             : 

VERBOSE: Performing the operation "Download item: 'ftp://backup.xxxxx.eu
/backup_old/xxx/xx_Config_Backup/AlertSender'" on target "".
Get-FTPItem : Exception calling "GetResponse" with "0" argument(s): "The remote
 server returned an error: (550) File unavailable (e.g., file not found, no acc
ess)."
At C:\PS_Scrips\PSFTP_1.ps1:13 char:45
+ ...  -Recurse | Get-FTPItem -localpath $local_path -Overwrite -Verbose #- ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep 
   tion
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio 
   n,Get-FTPItem

Could you help me please understand the cause of the problem and fix it?
Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.