Category filter

Script to download files on Windows devices

You can use custom scripts to perform almost all sorts of configurations on the devices. For example, when you want to pre-provision Windows devices with necessary files, you may use PowerShell commands to specify the file URL to download them directly to a specified location on the devices. These commands can be executed as scripts from the Hexnode portal to initiate file download on several devices.

Disclaimer:

The Sample Scripts provided below are adapted from third-party Open-Source sites.

Script to download files

The PowerShell script to download files from a given URL to a specific location on a Windows device is given below.

The $client.DownloadFile command takes two arguments: the file URL and the device location to download the file. The downloaded file takes after the file name you have provided in the second argument (Here, samplefile.pdf).

Given above is a sample script that downloads a PDF file from the URL “https://www.hexnode.com/mobile-device-management/resources/hexnode-unified-endpoint-management.pdf” to the device location “C:\Users\Acer\Pictures\Saved Pictures\” . You may replace these arguments with the parameters that help download the necessary files to the devices.

Notes:

  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository