KB ID 0001212
Problem
The purpose of BranchCache is, (as the name implies) to cache files in branch sites, without the need for a local file server or DFS. There are essentially two deployment models, In Hosted Mode a server in the branch caches the files locally as they are requested by clients.
This works because the main file server provides a hash of the requested file, the branch server will download it, and if another client asks for the same file it can check the hash on it’s local copy to see if it’s been updated, if not it serves the file locally without the need to be downloaded again. As the branch connections are typically slower, this makes things a lot more efficient.
Note: You cannot deploy BranchCache on a RODC domain controller.
But what if there is no server onsite? Then you can use Distributed Mode, where every client can download and cache a copy, then the clien’s serve the files to each other.
Solution
Deploy The Main Office BranchCache File Server.
BrachCache for Network Files is a server role, select it and complete the Wizard.
You can carry out the following procedure with domain group policy, but it’s just as easy to setup in local group policy, on the file server. Windows Key + R > gpedit.msc > Computer Configuration > Administrative Templates > Network > Lanman Server > Hash Publication for Branch Cache.
Enable the policy and set to Allow hash publication for all share folders > Apply > OK.
Note: You have enabled Hashing for ‘All shares ‘so the next step is a moot point. If you selected ‘Allow hash publication only for shared folders on which BrancCache is enabled’, then you would definitely need to do the following!
Now on the ‘Shares’ select the caching option.
Enable BranchCache.
Now I’ve created a Domain Group Policy called ‘BranchCache Firewall Policy’. Because to serve files you need to enable a couple of pre-configured firewall rules.
Computer Configuration > Policies > Windows Settings > Security Settings > Windows Firewall with Advanced Security > Inbound Rules > Add Rule.
Enable the pre-configured rule for ‘BranchCache – Content Retrieval (Uses HTTP).
Repeat the procedure and also add a rule for ‘BrachCache – Peer Discovery (Uses WSD)’.
Deploy The Branch Office ‘Hosted BranchCache’ Server.
Just as you did at the main office, install the ‘Brach Cache for Network Files’ Role.
But this time install the additional BrachCache Server Feature.
The server will be serving files, so link the ‘BranchCache Firewall Policy‘ to the OU that contains the branch server. Then to start it servicing files, issue the following command;
[box]Enable-BCHostedServer -RegisterSCP[/box]
To make sure it’s running;
[box]Get-BCStatus[/box]
Ensure ContentServerIsEnabled has been set to ‘True‘.
If you scroll to the bottom of the output, you can see where the cache is going to live, and what ‘percent’ of the drive size it can grow to. You can change these two values.
To Move BrachCache Folder Location
In this example I’ve got a volume on my Branch server, and I’ve created a folder on there to store my cached files in.
[box]Set-BCCache -MoveTo {Drive:)\{Folder}[/box]
To Change BrachCache Drive Percentage
[box]Set-BCCache -Percentage {Percent}[/box]
BranchCache Configure Client PC’s (For Hosted Mode)
Create a new policy and link it to the OU that your branch client PC’s are in.
Edit it.
Navigate to;
Computer Configuration > Policies > Administrative Templates > Network > BranchCache.
Policy: Turn on Branch Cache: Enabled.
Policy: Enable Automatic Hosted Cache Discovery by Service Connection Point: Enabled.
To test, (after the policy had been applied/refreshed). On a client PC issue the following command;
[box]netsh branchcache show status all[/box]
Ensure current status is ‘running’.
BranchCache Configure Client PC’s (For Distributed Mode)
If your client machines are going to serve BranchCache files, you will need to link the ‘BrachCache Firewall Policy‘ you created above to the OU that contains the client PC’s in the branch site.
Create a new policy and link it to the OU that your branch client PC’s are in.
Edit it.
Navigate to;
Computer Configuration > Policies > Administrative Templates > Network > BranchCache.
Policy: Turn on Branch Cache: Enabled.
Policy: Set BranchCache Distributed Cache Mode: Enabled.
Policy: Configure BranchCache for network files: Enabled.
Policy: Maximum round trip network latency: 0 (zero)
Related Articles, References, Credits, or External Links
NA
you mention that “Note: You cannot deploy BranchCache on a writable domain controller.” Does that mean you can deploy branchcache host on a RODC?
Yes thanks Peter – to much coffee!