Testing Multiple Subnets for BranchCache support

This post is for testing if your network is correctly configured for BranchCache. Now, if you are already using our StifleR product, it’s agent already does that for you. So this post is for you who just want to get BranchCache operational using nothing but ConfigMgr and a bit of PowerShell. Well, this post actually covers some cool automation techniques that can be used for other stuff, so you might want to keep reading either way 🙂


BranchCache is a native Windows component that uses WS-Discovery to find peers with content (WS-Discovery is a multicast based discovery over the address and port 3072. Once peers are located, any data is sent/received using unicast. However, if your network does not allow the discovery, BranchCache won’t find any peers to get content from.

In the Planning for BranchCache post, you learned how to use BCMon.exe, one of our free utilities, to test if support for BranchCache was enabled on the network equipment on a given subnet. Running BCMon.exe manually is perfectly fine if you only have a few subnets, but earlier this year I was helping a customer with a bit over 3000 subnets, and as fun as remoting into computers is, doing that about 6000 times didn’t sound too much fun (you need at least two computers in every subnet, so 3000 x 2 = 6000 machines). PowerShell to the rescue.

Testing for WS-Discovery support

To verify that WS-Discovery is working, you need at least two clients on every subnet, one that sends the request, and one that receives it. When I tested, I only tested networks with four active clients or more. Anyway, the scripted test does the following:

  • Locates all subnets with four or more active clients
  • On each of those subnets, four clients are selected. Two for sending discovery data using BCMon.exe, two for receiving the data using BCMon.exe.
  • The data is then collected, and uploaded to a central share
  • Once the clients uploaded their data, a report is being generated

Setting up the Test

1. Create a shared folder to which clients can upload their result. In my case I created a folder named E:\HealthCheck, shared it as HealthCheck$, and allowed domain computers to write to it. Inside the E:\HealthCheck I created three subfolders:

  • BCMon
  • BCMonResults
  • Scripts

2. Download BCMon.exe from https://2pintsoftware.com/products/branchcache-monitor and copy to E:\HealthCheck\BCMon.

3. Download the sample scripts, copy to E:\HealthCheck\Scripts, and then change the share name on line #1 in each Invoke* script to match your environment.

Line #1: $HealthCheckPath = “\\CM01\HealthCheck$”

4. Modify line 1-3 in the Invoke-MassBCMonProbing.ps1 script to match your environment

$SiteServer= “CM01”
$DatabaseServer= “CM01”
$Database = “CM_PS1”

5. From the scripts you downloaded, create and approve two “Run Script” scripts in ConfigMgr. One that runs BCMon.exe to send discovery data, and the other to receive discovery data. Name the scripts:

  • Run BCMon ProbeMatch
  • Run BCMon ProbeV2

Note: These scripts copies down the BCMon.exe utility to the clients, runs the utility, and then uploads the result.

Running the Test

Once the two “Run Scripts” has been created, you simply need to run a third scripts that runs the whole test:

1. From a PowerShell prompt, run the Invoke-MassBCMonProbing.ps1 script

2. Once the data has been collected, run the New-BCMonReport.ps1 script, and review the result in the BCMonSummaryReport.csv file in either Notepad or Excel.