BITSADMIN

Manage the Background Intelligent Transfer Service (BITS). The BITS Service can be used to transfer large files from remote hosts. BITS supports throttled and asynchronous transfer of files between machines using idle network bandwidth. This service is used by Windows Update, SUS, SMS and many third party packages.

BITSADMIN is deprecated in Windows 7 and 2008 R2, it is superceeded by the new PowerShell BITS cmdlets.

Syntax
      BITSADMIN [/RAWRETURN] [/WRAP | /NOWRAP] command

The following commands are available:

   /UTIL /?          Print the list of utilities commands
   /PEERCACHING /?   Print the list of commands to manage Peercaching
   /CACHE /?         Print the list of cache management commands
   /PEERS /?         Print the list of peer management commands

   /LIST    [/ALLUSERS] [/VERBOSE]     List the jobs
   /MONITOR [/ALLUSERS] [/REFRESH sec] Monitor the copy manager
   /RESET   [/ALLUSERS]                Delete all jobs in the manager

   /TRANSFER job name [type] [/PRIORITY priority] [/ACLFLAGS flags]
          remote_url local_name
                                       Transfer one of more files.
       [type] may be /DOWNLOAD or /UPLOAD; default is download
       Multiple URL/file pairs may be specified.
       Unlike most commands, job name may only be a name and not a GUID.

   /CREATE [type] job name             Create a job
       [type] may be /DOWNLOAD, /UPLOAD, or /UPLOAD-REPLY; default is download
       Unlike most commands, job name may only be a name and not a GUID.

   /INFO job [/VERBOSE]                Display information about the job

   /ADDFILE job remote_url local_name  Add a file to the job

   /ADDFILESET job textfile            Add multiple files to the job
      Each line of textfile lists a file's remote name and local name, separated
      by spaces.  A line beginning with '#' is treated as a comment.
      Once the file set is read into memory, the contents are added to the job.

   /ADDFILEWITHRANGES  job remote_url local_name range_list
      Like /ADDFILE, but BITS will read only selected byte ranges of the URL.
      range_list is a comma-delimited series of offset and length pairs.
      For example,

       0:100,2000:100,5000:eof

      instructs BITS to read 100 bytes starting at offset zero, 100 bytes starting
      at offset 2000, and the remainder of the URL starting at offset 5000.

   /REPLACEREMOTEPREFIX job old_prefix new_prefix
       All files whose URL begins with old_prefix are changed to use new_prefix

      Note that BITS currently supports HTTP/HTTPS downloads and uploads.
      It also supports UNC paths and file:// paths as URLS

   /LISTFILES job                     List the files in the job
   /SUSPEND job                       Suspend the job
   /RESUME job                        Resume the job
   /CANCEL job                        Cancel the job
   /COMPLETE job                      Complete the job

   /GETTYPE job                       Retrieve the job type
   /GETACLFLAGS job                   Retrieve the ACL propagation flags

   /SETACLFLAGS job ACL_flags         Set the ACL propagation flags for the job
     O - OWNER       G - GROUP
     D - DACL        S - SACL 

     Examples:
         bitsadmin /setaclflags MyJob OGDS
         bitsadmin /setaclflags MyJob OGD

   /GETBYTESTOTAL job                 Retrieve the size of the job
   /GETBYTESTRANSFERRED job           Retrieve the number of bytes transferred
   /GETFILESTOTAL job                 Retrieve the number of files in the job
   /GETFILESTRANSFERRED job           Retrieve the number of files transferred
   /GETCREATIONTIME job               Retrieve the job creation time
   /GETMODIFICATIONTIME job           Retrieve the job modification time
   /GETCOMPLETIONTIME job             Retrieve the job completion time
   /GETSTATE job                      Retrieve the job state
   /GETERROR job                      Retrieve detailed error information
   /GETOWNER job                      Retrieve the job owner
   /GETDISPLAYNAME job                Retrieve the job display name
   /SETDISPLAYNAME job display_name   Set the job display name
   /GETDESCRIPTION job                Retrieve the job description
   /SETDESCRIPTION job description    Set the job description
   /GETPRIORITY    job                Retrieve the job priority
   /SETPRIORITY    job priority       Set the job priority
      Priority usage choices:
         FOREGROUND
         HIGH
         NORMAL
         LOW
   /GETNOTIFYFLAGS job                Retrieve the notify flags
   /SETNOTIFYFLAGS job notify_flags   Set the notify flags
   /GETNOTIFYINTERFACE job            Determines if notify interface is registered
   /GETMINRETRYDELAY job              Retrieve the retry delay in seconds
   /SETMINRETRYDELAY job retry_delay  Set the retry delay in seconds
   /GETNOPROGRESSTIMEOUT job          Retrieve the no progress timeout in seconds
   /SETNOPROGRESSTIMEOUT job timeout  Set the no progress timeout in seconds
   /GETMAXDOWNLOADTIME job            Retrieve the download timeout in seconds
   /SETMAXDOWNLOADTIME job timeout    Set the download timeout in seconds
   /GETERRORCOUNT job                 Retrieve an error count for the job

   /SETPROXYSETTINGS job usage        Set the proxy usage
      usage choices:
       PRECONFIG   - Use the owner's IE defaults.
       AUTODETECT  - Force autodetection of proxy.
       NO_PROXY    - Do not use a proxy server.
       OVERRIDE    - Use an explicit proxy list and bypass list.
                     Must be followed by a proxy list and a proxy bypass list.
                     NULL or "" may be used for an empty proxy bypass list.

Examples:
      bitsadmin /setproxysettings MyJob PRECONFIG
      bitsadmin /setproxysettings MyJob AUTODETECT
      bitsadmin /setproxysettings MyJob NO_PROXY
      bitsadmin /setproxysettings MyJob OVERRIDE proxy1:80 "local"
      bitsadmin /setproxysettings MyJob OVERRIDE proxy1,proxy2,proxy3 NULL

   /GETPROXYUSAGE job                 Retrieve the proxy usage setting
   /GETPROXYLIST job                  Retrieve the proxy list
   /GETPROXYBYPASSLIST job            Retrieve the proxy bypass list

   /TAKEOWNERSHIP job                 Take ownership of the job

   /SETNOTIFYCMDLINE job program_name [program_parameters]
       Sets a program to execute for notification, and optionally parameters.
       The program name and parameters can be NULL.
       IMPORTANT: if parameters are non-NULL, then the program name should be the
                  first parameter.

     Examples:
       bitsadmin /SetNotifyCmdLine MyJob c:\windows\system32\notepad.exe  NULL
       bitsadmin /SetNotifyCmdLine MyJob c:\foo.exe "c:\foo.exe parm1 parm2"
       bitsadmin /SetNotifyCmdLine MyJob NULL NULL

   /GETNOTIFYCMDLINE job               Return the job's notification command line

   /SETCREDENTIALS job target scheme username password
     Adds credentials to a job.
     target may be either SERVER or PROXY
     scheme may be BASIC, DIGEST, NTLM, NEGOTIATE, or PASSPORT.

   /REMOVECREDENTIALS job target scheme
     Removes credentials from a job.
   /GETCUSTOMHEADERS job                        Get the Custom HTTP Headers
   /SETCUSTOMHEADERS job header1 header2 ...    Set the Custom HTTP Headers
   /GETCLIENTCERTIFICATE job                    Get the job's Client Certificate Information
   /SETCLIENTCERTIFICATEBYID job store_location store_name hexa-decimal_cert_id
     Set a client authentication certificate to a job.
     store_location    may be
       1(CURRENT_USER), 2(LOCAL_MACHINE), 3(CURRENT_SERVICE),
       4(SERVICES), 5(USERS), 6(CURRENT_USER_GROUP_POLICY),
       7(LOCAL_MACHINE_GROUP_POLICY) or 8(LOCAL_MACHINE_ENTERPRISE).

   /SETCLIENTCERTIFICATEBYNAME job store_location store_name subject_name
     Set a client authentication certificate to a job.
     store_location may be
       1(CURRENT_USER), 2(LOCAL_MACHINE), 3(CURRENT_SERVICE),
       4(SERVICES), 5(USERS), 6(CURRENT_USER_GROUP_POLICY),
       7(LOCAL_MACHINE_GROUP_POLICY) or 8(LOCAL_MACHINE_ENTERPRISE).

   /REMOVECLIENTCERTIFICATE job                Remove the Client Certificate Information from the job

   /SETSECURITYFLAGS job value
      Set the HTTP security flags for URL redirection and checks performed on the server cert. during the transfer.
      The value is an unsigned integer with the following interpretation for the bits in the binary representation.
        Enable CRL Check                                 : Set the least significant bit
        Ignore invalid common name in server certificate : Set the 2nd bit from right
        Ignore invalid date in  server certificate       : Set the 3rd bit from right
        Ignore invalid certificate authority in server
          certificate                                    : Set the 4th bit from right
        Ignore invalid usage of certificate              : Set the 5th bit from right
        Redirection policy                               : Controlled by the 9th-11th bits from right
            0,0,0  - Redirects will be automatically allowed.
            0,0,1  - Remote name in the IBackgroundCopyFile interface will be updated if a redirect occurs.
            0,1,0  - BITS will fail the job if a redirect occurs.

        Allow redirection from HTTPS to HTTP             : Set the 12th bit from right

   /GETSECURITYFLAGS job   
      Report the HTTP security flags for URL redirection and checks performed on the server certificate during the transfer.

   /SETVALIDATIONSTATE job file-index true|false
          starts from 0         
       Set the content-validation state of the given file within the job.

   /GETVALIDATIONSTATE  job file-index
          starts from 0         
       Report the content-validation state of the given file within the job.

   /GETTEMPORARYNAME  job file-index
      file-index starts from 0         
       Report the temporary filename of the given file within the job.

The following options control peercaching of a particular job:

   /SETPEERCACHINGFLAGS  job value
       Sets the flags for the job's peercaching behavior.
       The value is an unsigned integer with the following interpretation for the bits in the binary representation.
           Allow the job's data to be downloaded from a peer : Set the least significant bit
           Allow the job's data to be served to peers        : Set the 2nd bit from right

   /GETPEERCACHINGFLAGS  job               
       Report the flags for the job's peercaching behavior.

The following options are valid for UPLOAD-REPLY jobs only:

   /GETREPLYFILENAME job        Get the path of the file containing the server reply
   /SETREPLYFILENAME job path   Set the path of the file containing the server reply
   /GETREPLYPROGRESS job        Get the size and progress of the server reply
   /GETREPLYDATA     job        Dump the server's reply data in hex format

The following options can be placed before the command:
   /RAWRETURN                     Return data more suitable for parsing
   /WRAP                          Wrap output around console (default)
   /NOWRAP                        Don’t wrap output around console

   The /RAWRETURN option strips new line characters and formatting.
   It is recognized by the /CREATE and /GET* commands.


Commands that take a job parameter will accept either a job name or a job ID GUID inside braces.

BITSADMIN reports an error if a name is ambiguous.

Many commands are only compatible with Microsoft IIS servers (e.g. upload).

BITSADMIN is deprecated in Windows 7 and 2008 R2, it is superceeded by the new PowerShell BITS cmdlets.

Examples

Create a new download job:
C:\> Bitsadmin /create /download SS64

Add a file that we want to download to the job and specify a location where the downloaded file will be stored:
C:\> Bitsadmin /addfile SS64 http://download.sysinternals.com/files/PSTools.zip c:\PSTools.zip
C:\> Bitsadmin /resume SS64


Check if a download job has finished and if so complete the job:
C:\> Bitsadmin /info SS64 /verbose | find "STATE: TRANSFERRED"
C:\> IF %ERRORLEVEL% EQU 0 bitsadmin /complete SS64

“Downloading is definitely on the rise, but not because it's free - that's probably third on the list - but because it's immediate and the selection is virtually unlimited” ~ Don Rose

Related:

ROBOCOPY - Robust File and Folder Copy
FTP- File Transfer Protocol
Powershell: Bits cmdlets
Equivalent bash command (Linux): wget - Retrieve web pages or files, curl - Transfer data to or from a server


© Copyright SS64.com 1999-2014
Some rights reserved