Execute package task asking password if I saved the package with "Encrypt All with password" - ssis

I Have a Package which will execute 7 packages using execute package task. Those 7 packages are saved with protection level as "Encrypt all data with password".
While configuring Execute Package task I selected the Location as "File System". Daily I need to run this package manually. But the Problem is I need to give password for all the 7 packages every time I want to execute it. Usually I run this package during lunch time.
Is there anyway I can store the package password programmatically? If I ran it yesterday and I didn't close the BIDS and I'm running it again today this will not ask for the password.
I also tried to build the package after the first run where it didn't ask for the password. Then I run it again without closing the BIDS. But this is still not working.

Even if you store the package passwords SSIS will always prompt you for entering the password when you are using BIDS to execute it . This is because BIDS try to open the individual child package designer and hence prompts you for entering the password .
So the only way is to execute it without the dialogue prompt for password is to use sql agent or dtexec utility
1.In order to execute the child packages i suggest you to create a config file for the parent package and select the property Package Password for all your Execute Package Task
2.Now in the config file enter the password for all the individual execute package task
<Configuration ConfiguredType="Property" Path="\Package\Execute Package Task.Properties[PackagePassword]" ValueType="String">
<ConfiguredValue>Password</ConfiguredValue>
</Configuration>
3.Execute your package using dtexec utility
dtexec.exe /f "PackageLocation/Parent.dtsx"

Related

SSIS package execute application(. exe) file which is protected by password

I have a application (. Exe) file,
At the time of running, it is asking the password to process.
My task is to run that exe file using SSIS package and pass the static password at the runtime.
Kindly help me to resolve my issue.
It is a matter of making the Arguments as an expression. In that expression you can pass the entire command line string including the password. This when you expose it via Package Configuration, it can then be made dynamic. Here is a link that shows how a SQL Server Package is used to zip a file with password which you can use to tweak for your package - SSIS: How to Compress/Zip your file using 7-Zip?

SSIS - EXECUTE PROCESS TASK The process exit code was "16" while the expected was "0"

IN The SSIS package I am getting execute process task error; exit code was 16 expected was 0 I am using robocopy however when I use robcopy from command prompt it successfully copy my zip files from one folder to another folder.
Please help me in resolving this issue.
Thanks
A return code of 16 suggest you have permissions issues. If you are running your package via SSDT/BIDS, make sure you are running it as an administrator.
To open BIDS/SSDT as an administrator, right click on the shortcut and hit run as administrator, then open your solution.
If you are running it via Sql server agent job make sure the user/proxy account you are using has required access/permission.

SSIS: pass package password to child package

I have a master SSIS package that calls child packages that have ProtectionLevel = EncryptSensitiveWithPassword and a password. When the master tries to to execute a child package, I am prompted for the child package password.
The child packages are in a Sequence Container. Within that definition, there is a "Package Password" property, and I have set that, but it still prompts for the password. I also notice that there is no settable property for packagepassword in the expressions editor.
I have tried defining the password as a parent variable, but it is not working -- still get prompted for the packagepassword. So I was thinking about using a SQL Server configuration table, but can not find the proper value to put in the "PackagePath" column.
Or any other suggestions/words of wisdom -- many thanks!
Steve
I have encountered the same kind of issue today and just updating that solution here as there is no answer given for this question.
We have to make sure the password has been updated on Master.dtsx --> Execute Package Task Editor (double click on Execute Package Task) --> Packages --> Password.
Enter the same password which you have set for the package and then run the Master package.

where to set the package password property

I have an SSIS package with protection level - EncryptSensitiveWithPassword and I can execute this package with in the BIDS.
While trying to deploy to file system using the Package Deployment Wizard I receive the error
The protection level of the package requires a password but the
package password property is empty
Where should I set this password? (In BIDS in the designer I have set this password and while trying to open the project it even asks me for the password) So for deployment is there a another property to set?
This error is generally caused due to the property PackagePassword being empty in your configuration. Kindly check it and if it's not set, set it.
Also change the protection level to DontSaveSensitive after opening the package using the password. Then add the packages to your solution and once you are done, make the protection level as SaveSensitiveWithPassword.
Try deploying your package with these settings.
Reference:Securing your SSIS Packages
As per the answer by user2339071, if you don't have any passwords in your connections (i.e. you use windows trusted security) then you don't actually need a password.
But, assuming you do... (perhaps you could calrify in the original question):
My understanding is that the package password is basically specified at runtime, not deployment time.
When your DTSX file exists in the file system (after deploying it or copying it there directly), then you need to execute it somehow and that's where you specify the package password.
For example if you use SQL Agent to run your package you will find a field in the job to enter that package password. If you use DTEXEC.EXE directly, there is a switch in there for your package password also.
Personally I don't use the package deployment wizard, I just copy the DTSX file to the target file location.
Set or change the protection level of the package or packages by using a command similar to the one of the following examples:
The following command sets the ProtectionLevel property of an individual package in the file system to level 2, "Encrypt sensitive with password", with the password, "strongpassword":
dtutil.exe /file "C:\Package.dtsx" /encrypt file;"C:\Package.dtsx";2;strongpassword
The following command sets the ProtectionLevel property of all packages in a particular folder in the file system to level 2, "Encrypt sensitive with password", with the password, "strongpassword":
for %f in (*.dtsx) do dtutil.exe /file %f /encrypt file;%f;2;strongpassword
If you use a similar command in a batch file, enter the file placeholder, "%f", as "%%f" in the batch file.
You can also easily set the package password by going into the 'Package Explorer' then right click on the package to go into the properties and set your protection level there.

SSIS package not running when called as step in SQL Job

I have a .dtsx file (an SSIS package) that downloads files from an FTP server and imports data. It runs fine whenever I run it manually. However, when I schedule calling the package as a step in a SQL server agent job, it fails. The step it fails at is the one where I call a .bat file. The error in the job history viewer says this:
Error: 2009-05-26 12:52:25.64
Code: 0xC0029151 Source: Execute
batch file Execute Process Task
Description: In Executing
"D:\xxx\import.bat" "" at "", The
process exit code was "1" while the
expected was "0". End Error DTExec:
The package execution returned
DTSER_FAILURE (1).
I think it's a permissions issue, but I'm not sure how to resolve this. The job owner is an admin user, so I've verified they have permissions to the directory where the .bat file is located. I've tried going into Services and changing the "Log On As" option for SQL Server Agent, and neither option works (Local System Account and This Account). Does anyone have ideas as to what other permissions need to be adjusted in order to get this to work?
I tried executing just the batch file as a SQL Job step, and it gave more specifics. It showed that it failed when I was trying to call an executable, which was in the same directory as my .bat file, but not in the windows/system32 directory, which is where it was executing from.
I moved the executable to the system32 directory, but then I had no clue where my files were being downloaded to. Then I found that there's a property for the Execute Process Task (the one that executes the .bat) called WorkingDirectory. I set this to be the directory where the bat is located, moved the executable back into the same one as the .bat file, and it's now working as expected.
For me it was a permissions issue. Go to Environment --> Directories, then change Local directory to something the SQLAgentUser can access. I used C:\temp. Click the dropdown for Save, and choose "Set defaults".
Are you executing the SSIS job in the batch file, or is the batch file a step in the SSIS control flow?
I'm assuming the latter for this answer. What task are you using to execute the batch file (e.g. simple execute program task or a script task). If the latter, it looks like your batch file is actually failing on some step, not the SSIS script. I'd check the permissions of what your batch file is trying to access
In fact, it might be a better idea to rewrite the batch file as a script task in SSIS, because you'll get much better error reporting (it'll tell you which step in the script fails).
You could try executing the batch file using the runas command in a command window. If you try and execute it under the local system or network system account, it should give you a better error. If it does error, you can check the error level by going "echo %ERRORLEVEL%".
If it wasn't the latter, and you're executing the SSIS package via a batch file, why?
Are you possibly accessing a mapped drive in your .bat file? If so, you can't rely on the mapped drive from within the service, so you'd have to use UNC path.
I had the same error and I resolved it by logging on to the user account that runs the job, opened Coreftp site in question there, test the site access, made the change there (in my case, I had to reenter the new password) and now it works.
So yes, it is an issue of file access. This one is file access to the coreftp site in question.