|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Monday, November 16, 2009 2:57 AM
Points: 29,
Visits: 52
|
|
Why should i have to protect my package with a password in Visual Studio in order to run my job in Management Studio properly? I thought that the setting "EncyrptSensitivewithPassword" just refers to the package or do i have to protect my packages with passwords in order to execute them on the management Studio?
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, May 24, 2009 8:42 PM
Points: 6,
Visits: 33
|
|
I have the same problem. I can run ftp.exe and do my ftp task. but it just doesn't work when i do it through ftp task. I'm connecting to a unix box and my path is in the /dir1/dir2/dir3/file.trg format. i'm using a variable to store this value. what is wrong? Anyone?
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, November 27, 2006 11:52 PM
Points: 4,
Visits: 1
|
|
Hello , I wanted to know how to make a dynamic FTP Connection. My FTP Server will be having a FTP server Name , File path, FTP Server Name, FTP User Name, FTP Password. Our Database maintains different FTP servers for different clients.In DTS we used below code in activex script task to connect to the FTP Dynamically. "Set objTask = objPackage.Tasks(cstr("DTSTask_DTSFTPTask_2")).CustomTask objTask.SourceLocation = 0 objTask.sourcesite = DTSGlobalVariables("g_str_ftpservername").Value objTask.SourceUsername = DTSGlobalVariables("g_str_ftpusername").Value objTask.SourcePassword = DTSGlobalVariables("g_str_ftppassword").Value objTask.NonOverwritable = False objTask.SourceFilename = srcFiles objTask.destsite = DTSGlobalVariables("g_str_filelocation").Value Now we are migrating our workflows to SSIS (SQL Server 2005). The problem is we are unable to find solution for dynamically connecting to FTP Server which maintains a password. Can any body help please. Thanks, Kiran G
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, February 05, 2008 11:03 AM
Points: 1,
Visits: 4
|
|
Hi,
I have the same problem as the original poster, whose question didn't seem to be answered.
I can get a file via FTP from the command line, and the FTP connection in SSIS tests successfully, but the directories and files are not visible through SSIS.
Any help appreciated.
Thanks,
Elias
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, November 02, 2009 2:15 PM
Points: 3,
Visits: 25
|
|
Hi, I haven't found a solution, but I have found a working around using the Execute Process Task. In the Execute Process Task Editor, Process page I set: - Executable to ftp.exe
- Arguments to -s:FTP_Script.txt
- Working directory to C:\
The C:\ directory contains my FTP_Script.txt file, which logons to the remote FTP server and transfer my file named TRGL.TXT from the FTP server root directory to the c:\ drive of the SQL server: OPEN FTP_SERVER logonid password GET /TRGL.TXT C:\trgl.txt DELETE /TRGL.TXT bye It annoys the crap out of me, because it ignores the apparent functionality of the FTP Task, but what else can a bloke do?
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Yesterday @ 8:29 AM
Points: 670,
Visits: 374
|
|
I had the same problem with my FTP Task. The problem is that the package views the FTP password as "sensitive information" and the default setting is "EncryptSensitiveWithUserKey". This setting will only allow the user name that created the package to run it successfully. When you create the job step to execute the package, the package is not running under your user key. The workaround that I was able to implement was to change the encryption to "EncryptAllWithPassword". Right above that property, change the PackagePassword by clicking on "..." and inputting a password. Now, whenever you open the package, you will need to have a password in order to edit it. To ensure that this functions properly, close the package after changing the setting, re-open it to edit and it should prompt you for the password. Enter in the password for the FTP connection and then re-save it and close. Within the job step, when you try to edit the command line, it should prompt you for the package password. Once you enter the package password, it should add the following switch to the command line "/DECRYPT <password>", where <password> is your package password. The only issue here then is that the command line is not encrypted, but I satisfied for now to have the package working properly as a job. I was able to successfully execute my package, which includes an FTP upload, with no problems from the SQL Server Agent account by using this methodology.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, February 12, 2008 11:02 AM
Points: 1,
Visits: 9
|
|
| How do you pass an FTP connection manager password in a configuration file?
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Friday, November 13, 2009 4:05 AM
Points: 387,
Visits: 476
|
|
Ahmet Akin (6/29/2006)
The Package works really fine, when i run my Package local, the flatfiles had been sent successfully to the FTP-Host.
But as i start the Package from the Management Studio, i get the same failure message as described above.
Do i also have to type in the password in theconnection string (connection manager)?
If package is deployed on destination server then Protection level must be set to EncryptAllWithPassword and password must be set for this package. Next this package must be deployed on this server with suppling with above password.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, May 24, 2009 8:42 PM
Points: 6,
Visits: 33
|
|
Dear all, i had the same problem with the FTP Task not working. I realised that when the FTP Task does a listing, the unix box returns not only the file name but the timestamp as well. Eg, Problem 1 directory on the unix box /files File1.trg File2.trg
When listing from FTP Task: remote directory = /files "10:00 File1.trg" "12:00 File2.trg"
Now, when the ftp task tries to get these files, its not found, or throws some error.
Problem 2 Passwords. Using a batch file to script the FTP is not a good solution, because at the end of the day, your password is clearly visible in plaintext in the script. Not a good solution. Using the package configuration file (*.dtsConfig) is useless as it too stores passwords in plaintext (till now, ssis hasn't implemented encrypted configuration files). Don't even think of using enterprise library with SSIS, you'll run into major headaches.
Solution I've since given up on using the FTP task for my FTP, but we can still use SSIS's FTP plumbing and with some extra coding, make a properly platform independent and secure FTP function.
I've removed the error checking and variable assignment to make things easier to read. Steps: 1. Create a FTP Connection Manager in your SSIS Designer 'RightClick in Connections > New Connection... > FTP'. 2. Create a variable to store the password. Setup the package to use configuration file to store the password variable (and other information you need). 3. Fill in the FTP information as needed. 3. 4. Write a simple .net application that does string encryption. I won't put code for this here. You can google how to do this easily. 5. Use this tool to navigate the xpath of the dtsConfig file to password variable's value and encrypt it. This way, the password is not plaintext on the dtsconfig file. 6. Create a script task to take the password variable's (as readwrite) value and 'decrypt' it, remember to use whatever method was used to encrypt it in your separate .net app. Assign the decrypted password back to itself. 6. Create a script task to do the FTP functionality.
Public Sub Main() 'TODO: assign variables here... dim password as string = dts.variables("vPassword").value.tostring 'the decrypted password
'Get instance of the connection manager. Dim cm As ConnectionManager = Dts.Connections("FTPConnMgr") 'Set the password property to the decrypted password cm.Properties("ServerPassword").SetValue(cm, password)
'create the FTP object that sends the files and pass it the connection created above. Dim ftp As FtpClientConnection = New FtpClientConnection(cm.AcquireConnection(Nothing))
'Connect to the ftp server ftp.Connect()
ftp.SetWorkingDirectory(remoteDir) 'set the remote directory Dim files(0) As String files(0) = fileToGet 'eg. File1.trg
'Get the file ftp.ReceiveFiles(files, localDir, True, True)
' Close the ftp connection ftp.Close()
Dts.Events.FireInformation(0, context, "File " + fileToGet + " retrieved successfully.", Nothing, Nothing, True) Dts.TaskResult = Dts.Results.Success
End Sub So there you go. An ssis package that decrypts a encrypted password on a dtsconfig file, decrypts it at runtime, and doesn't use batch files that expose the password.
If you'd like to know how to do a batch get of all files in a directory, i can show in another post. Whenever you need to change the password, just use that separate .net app to modify the dtsconfig file. Nothing needs to be done on the package.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Monday, August 03, 2009 10:33 AM
Points: 14,
Visits: 65
|
|
Gunaseelan,
Thanks! That code snippet helped me solve an issue I had using the FTP Task to receive a file from a Tandem (HP Nonstop) server.
The FTP task wouldn't let me specify the path because it didn't start with a "/", so I used the Script you posted, popped in my path to the ftp.SetWorkingDirectory, and away it went. Script task is your friend 
Rob
|
|
|
|