You are here:   Research
  |  Login

Welcome to my blog, quickest way to find articles is usually to search for them.

Minimize
Search in All Title Contents
 
     

Setup BITS for ConfigMgr Current Branch

May 28 2017

When using ConfigMgr in distributed environments, there are times when you want to limit how much bandwidth a client is using when downloading content. In all fairness, when having techniques like Peer Cache, and BranchCache at your disposal, you may get away by not limiting the bandwidth, but for most distributed environments you probably want to configure BITS to control how much bandwidth that is used over the WAN links. BITS is after all the component that is used for the actual downloads.

Creds: Some bits (I’m so funny), of this guide are totally stolen with pride from the Administrators Guide to BranchCache by the folks at 2pintsoftware (they said it was ok as long as mentioned them and linked to the original guide, so there :)  ). The remaining parts are from customer implementations and my own lab research.

Configuring BITS on the clients

BITS can be configured via both ConfigMgr client settings and group policy, but you have more granular options via group policy, and if you use the ConfigMgr Client Settings you basically kill BranchCache because of the missing “Ignore bandwidth limits if the source and the destination are on the same subnet “ setting. So configuring BITS via group policy it is :)

When configuring BITS via group policy there are two policies that you typically use. The work schedule and the maintenance schedule policies. The work schedule is where you do the main configuration, and the maintenance schedule can be used to override the work schedule if needed. In this guide, you simply just configure the work schedule.

To configure the work schedule policy, you create a new group policy object, and then you enable and configure the following policy:
Computer Configuration / Administrative Templates / Network / Background Intelligent Transfer Service / Setup a work schedule to limit the maximum network bandwidth used for BITS background transfers

As a good starting point, set the following values (adjust the bandwidth settings according to your WAN links):

  • Select the Ignore bandwidth limits if the source and the destination are on the same subnet check box
  • Work Days: Monday – Friday
  • Daily Work Hours: 7am – 8 pm
  • Bandwidth Limit During Work Hours: 4 Mbps for all priorities
  • Bandwidth Limit During Non-Work Hours: 12 Mbps for all priorities

    BITS
    The Setup a work schedule to limit the maximum network bandwidth used for BITS background transfers policy.

    Verifying that BITS works

    Verifying that the BITS works can be done by checking the event log on the client side. Windows 10 has detailed logging in the event viewer for its BITS transfers. 

    Here is a shiny script from Michael Niehaus (@mniehaus) that queries the event log on remote computers for BITS transfers.

    $prefix = "MN-"
    foreach ($i in 101..110)
    {
      $suffix = $i.ToString("000")
      $vmName = "$prefix$suffix"
     
      Get-WinEvent -ComputerName $vmName -FilterHashTable @{ LogName='*Bits*'; ID=4 } | % {
        $_ | Add-Member -MemberType NoteProperty -Name jobTitle -Value $_.Properties[1].Value;
        $_ | Add-Member -MemberType NoteProperty -Name bytesTransferred -Value $_.Properties[5].Value;
        $_ | Add-Member -MemberType NoteProperty -Name bytesTransferredFromPeer -Value $_.Properties[6].Value -PassThru;
      } | ? {$_.bytesTransferredFromPeer -gt 0} | Select MachineName, TimeCreated, jobTitle, bytesTransferred, bytesTransferredFromPeer | FT
    }
    

    In the preceding script you check for Event ID 4 which lists completed BITS jobs, and how much data that was copied from DPs vs Peers. Other events that can be interested are:

    Event 3. BITS Job is created
    Event 59. Your file gets added to the BITS job
    Event 60. File is copied, and you can check to see if the peerProtocalFlags is set (it should be 1 if you are BranchCaching)

    Here is another version of the script that I used in my lab. This loops through an OU in AD to find the machines instead of using a prefix/suffix type search:

    # Loop through the Chicago OU in AD, and view BITS info
    $Computers = Get-ADComputer -Filter * -Searchbase 'OU=Workstations Peer Cache Chicago,OU=ViaMonstra,DC=corp,DC=viamonstra,DC=com' | Select-Object -expand Name 
    
    foreach ($Computer in $Computers){
        Get-WinEvent -ComputerName $Computer -FilterHashTable @{ LogName='*Bits*'; ID=4 } | % {
        $_ | Add-Member -MemberType NoteProperty -Name jobTitle -Value $_.Properties[1].Value;
        $_ | Add-Member -MemberType NoteProperty -Name bytesTransferred -Value $_.Properties[5].Value;
        $_ | Add-Member -MemberType NoteProperty -Name bytesTransferredFromPeer -Value $_.Properties[6].Value -PassThru;
      } | ? {$_.bytesTransferredFromPeer -gt 0} | Select MachineName, TimeCreated, jobTitle, bytesTransferred, bytesTransferredFromPeer | FT
    }
    

      

    image
    Check the BITS job info via PowerShell on all machines in the Chicago OU.

     

    You can also use PowerShell BITS commands or the legacy bitsadmin (to be removed) to check BITS status. Here is the output from running bitsadmin /monitor while download a file from ConfigMgr using BITS.

    image
    Running bitsadmin /monitor.

     

    Troubleshooting BITS on the clients

    In order to troubleshoot BITS, using the BITS PowerShell module is a really good start. Here is a post by PFE Kevin (Microsoft).

    Troubleshooting BITS with PowerShell
    https://blogs.technet.microsoft.com/cmpfekevin/2014/01/29/troubleshooting-bits-with-powershell

    Another useful tip is resetting the BITS transfer queue. Here is a post by Nickolaj Andersen (@NickolajA).

    How to reset BITS transfer queue
    https://www.scconfigmgr.com/2014/03/28/how-to-reset-bits-transfer-queue

     

    Additional Resources

    For dynamic control of the BITS bandwidth settings, you might want to check out the StifleR solution from 2pintsoftware. It’s available in both free and paid versions.

    You also find related guides in this list:








    Happy deployment, and thanks for reading!
    / The Deployment Research team



    Ami Casto

    Johan Arwidmark

    Blog Archive

    Minimize