You can send files to multiple computers without user interaction.
Important: To distribute files, the user must be authenticated with Two-Factor Authentication (2FA). This added security step serves the security of the session, as no host credentials are needed.Authentication is required only once during the session. If 2FA is set to on demand, the user has to authenticate themselves when they click Create new job or Rerun, otherwise 2FA is done on login.
- On the Manage page under Remote Execution click Create new job.
Result: The Create job page is displayed.
- Add the File distribution step to the list on the left.
- Click Upload to select the file(s) you want to distribute.
Note: You can reference the file(s) from the script. You can upload up to three files per job with a maximum size of 1GB each. Any file can be used.
- Set the Destination Folder.
This field is displayed after you have selected a file to distribute.
Tip: The path may contain environment variables.
- Under Overwrite existing files, choose whether or not to overwrite files that already exist on the targeted computers.
- Under Folder creation behavior, select Create folders if they don't already exist to push files in folders.
- From the list of Computers define the computers or a group of computers that will receive the script.
- Enter a friendly name that you can easily remember later on.
- Click Run.
Note: A preset timeout pertains to both the job and the task.The timeout of the job is 24 hours. Practically this means that computers can download the script and report back the result for one day.
Task timeout is set to two hours, that is the target computer waits two hours for the script to start running.
Results:
Note: When you reference a file from the script, you only have to enter its name. The path of the file is stored in the central_FilesPath environment variable. Once the task ends, the file is deleted from the target computer, unless it is copied somewhere else with the script.
Example:
You upload 'a.txt' file for the job and you would like to copy it into a folder (also known as file distribution). Your script should look something like this:
Copy-Item a.txt C:\Destination