BranchCache useful commands

BranchCache useful commands

How to show current status of BranchCache service ?

Command:
netsh branchcache show status

How to disable BranchCache service ?

Command:
netsh branchcache set service DISABLED

How to enable distributed service mode in BranchCache ?

Command:

netsh branchcache set service mode=DISTRIBUTED

How to enable/change to local caching mode ?

Command:

netsh branchcache set service mode=LOCAL

Howto set status of a BranchCache service as Hosted cache server ?

Command:

netsh branchcache set service mode=HOSTEDSERVER clientauthentication=DOMAIN

How to set BranchCache service as hosted cache client ?

Command:

netsh branchcache set service mode=HOSTEDCLIENT location=SERVER1

How to save current configuration ? /How to create a script  that contains current configuration?

Command:
netsh branchcache dump

How to exports the content information key ?

Command:
netsh branchcache exportkey [outputfile=]<File Path> [passphrase]=<Pass
Phrase>

How to flush the contents of the cache ?

Command:
netsh branchcache flush

How to import new content information key ?

Command:netsh branchcache importkey [inputfile=]<File Path> [passphrase]=<Pass Phrase>


How to reset BranchCache service ?

Command: netsh branchcache reset

How to set cache size of the local cache?

Usage: netsh branchcache set cachesize [size=]{DEFAULT|} [[percent=]{TRUE|FALSE}]

Parameters:

size – The size of the cache. Entered as either a percentage or an exact number of bytes. Set to DEFAULT to restore the default configuration.

Percent – Determines if the size tag is treated as a percentage of the size of the hard disk or as an exact number of bytes.

Ignored if the size tag is set to DEFAULT.

TRUE – size is a percentage of the size of the hard
disk

FALSE – size is an exact number of bytes (Default)

Remarks: Sets the size of the BranchCache service’s local cache. The size can
be entered as either an exact number of bytes, or as a percentage of
the size of the disk. Note that this refers to the size of the disk
on which the cache is located, not the total size of all disks present
on this computer.

Examples:
netsh branchcache set cachesize DEFAULT
netsh branchcache set cachesize 40971520
netsh branchcache set cachesize size=30 percent=TRUE

How to displays help or list of commands ?
netsh branchcache help

Other commands

netsh branchcache show – Displays configuration parameters.
netsh branchcache smb – Changes to the `netsh branchcache smb’ context.