BITS is a great way to transfer large files if you have access to Powershell. It’s relatively easy to start a transfer, and using BITS has the added benefit of not negatively impacting your other tasks.
BITS will only use bandwidth that’s idle, making it great for file transfers that would normally saturate your system’s network utilization.
First, you need to import a the bitstransfer module:
import-module bitstransfer
To see all available commands available from this module, type:
get-help -name *-bitstransfer
Then, you can use the get-help cmdlet on a specific cmdlet to see the full details of syntax and usage. To start a simple BITS transfer, for example:
start-bitstransfer -source "\\server\share\Office2007.iso" -destination "C:\folder\"
You’ll notice as well, if you use get-help on the start-bitstransfer cmdlet that it offers options like “-authentication” and “-credential”, meaning you can pass credentials to initiate your transfers as opposed to running the shell as an account authorized to access the share. This can be an huge benefit if you need to transfer files from an administrative or highly secured share on a remote system.
Unfortunately, BITS does not support wildcards to transfer multiple files. For instance, the following does not work:
start-bitstransfer -source "\\server\share\*.iso" -destination "C:\folder\"
In order to utilize BITS on multiple files based on wildcards or other specific properties, you can use the get-childitem cmdlet (or its aliases ls or dir):
get-childitem "\\server\share\*.iso" |
select fullname |
foreach ($_.fullname){start-bitstransfer -source $_.fullname -destination "C:\folder\"
Since you’re utilizing pipelines, you can also add a “where-object” cmdlet between the select and foreach that will allow even more granularity in your filtering of files to transfer. An example would be:
get-childitem "\\server\share\*.iso" |
select fullname,isreadonly |
where-object{$_.isreadonly -eq $false} |
foreach ($_.fullname){start-bitstransfer -source $_.fullname -destination "C:\folder\"}
Please note: BITS is specifically designed for intelligent downloading, and is not a strong technology for uploading of one, or multiple files simultaneously.