Configuration Item for Microsoft Configuration Manager that sets/checks BranchCache clients settings. Tidy!
What it does:
Checks that Branchcache has been configured to use a specific TCP port for P2P transfers of content
Checks the Branchcache Cache TTL value - the amount of time that content is retained in the cache
Checks that the BranchCache service is set to 'Distributed Caching' mode
Checks the 'serve peers on battery power' capability
Finally - checks that the service is running and is set to AutoStart
If ANY of these checks fail - a status of Non-Compliance is reported, and the remediation script will run (if enabled)
Creates a Logfile in the TEMP folder for both discovery and remediation steps
Cache Size DISCOVERY/REMEDIATION
Checks that the current size of the branch cache is correct
Works out the free disk space, and then compares the current BranchCache Cache size setting
If the cache size is not correct (the system might be running low on disk space for example) - the remediation script will run (if enabled)
Here's the logic for the cache size calculation
if free space less than 10% new cache should be 2%
if free space less than 50% but more than 10% new cache should be 5%
if free space more than 50% new cache should be 10%
Note that the defaults in the CacheSize script shown above are fairly conservative - so feel free to be more aggressive with the cache size!
22.214.171.124 - Minor tweak - Serve on Battery setting is now a separate setting for clarity, and was getting reset in some scenarios.
126.96.36.199 - Minor tweak - now removes the old port 80 reservation after setting the new port ID
188.8.131.52 - Complete rewrite! Just 2 settings in there now. Main and Cache Size.
184.108.40.206 - Now removes all BranchCache Firewall Rules and Re-adds them, ensuing that you only have the rules that you require.