# CacheR operations

## Adding distribution points

Distribution Points in CacheR are currently used to represent availability only.

\
To add Distribution Points, open the **StifleR Dashboard** and navigate to **Cache Management**, then **CacheR**, and select **Distribution Points**. If multiple CacheR servers are present, select the CacheR server you want to configure.&#x20;

<figure><img src="https://2767179248-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSdKKJqJhW8GvhMBmgTTJ%2Fuploads%2FkxGyBu4f1anJPBq5Av97%2Fcacher_operations_DP_select.png?alt=media&#x26;token=402b453a-d32a-454a-b4d7-f7f32b285629" alt=""><figcaption></figcaption></figure>

Add a new Distribution Point and provide a friendly name and the root URL of the Distribution Point.&#x20;

<figure><img src="https://2767179248-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSdKKJqJhW8GvhMBmgTTJ%2Fuploads%2F5cVpadh9ivSdsLVpy6wM%2Fcacher_add_dp.png?alt=media&#x26;token=d55d9c2b-ab7a-4142-afc3-e087df6186e8" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2767179248-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSdKKJqJhW8GvhMBmgTTJ%2Fuploads%2FOhUXHEUf97OIB3D7MnPA%2Fcacher_dp_config.png?alt=media&#x26;token=b1e2907f-997b-48f7-a400-abf7247ced83" alt=""><figcaption></figcaption></figure>

Once added, the CacheR Worker service will process the entry. When processing is complete, the Distribution Point status will change to **Available**, confirming that it has been successfully detected and validated.

<figure><img src="https://2767179248-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSdKKJqJhW8GvhMBmgTTJ%2Fuploads%2FHCLDEaCZpy2A70kEQFC8%2Fcacher_DP_verify.png?alt=media&#x26;token=21805ff1-6cef-40a6-a7ef-12f10900e39a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2767179248-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSdKKJqJhW8GvhMBmgTTJ%2Fuploads%2FciFai7rdkpGWrlYWEzd1%2Fcacher_DP_verify2.png?alt=media&#x26;token=7346a5e2-efaa-4934-bcb1-08e212abd2bc" alt=""><figcaption></figcaption></figure>

## Tracking content

### Manually adding CacheTracks (packages)

Before manually creating CacheTracks, you must gather several required details. These include the **Package ID or Application ID**, the **Package Version** is the ConfigMgr details that is needed so those values need to be collected from there. And the **Base URL** where the content is hosted. Tools such as [**BCMon**](https://github.com/2pintsoftware/BranchCache/tree/master/BCMon) or the PowerShell script [**Get-ConfigMgrContentLocationFromMP.ps1**](https://github.com/2pintsoftware/ConfigMgr/blob/master/Get-ConfigMgrContentLocationFromMP.ps1) can be used to identify and confirm the correct content URLs.

<figure><img src="https://2767179248-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSdKKJqJhW8GvhMBmgTTJ%2Fuploads%2Fy44taQqDvZVljceNI6us%2Fcacher_cachetracks_contentlocations.ps1.png?alt=media&#x26;token=4d45f25a-42ac-47b2-9f21-41336fe7f026" alt=""><figcaption></figcaption></figure>

To add a CacheTrack, navigate to **Cache Management** in the StifleR Dashboard, then **CacheR**, and select **Packages**. Choose the appropriate CacheR server if prompted, then select **Add** to create a new package entry.&#x20;

<figure><img src="https://2767179248-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSdKKJqJhW8GvhMBmgTTJ%2Fuploads%2FFkwsfCp3UsQSjVVlNqB0%2Fcacher_cachetrack_adding.png?alt=media&#x26;token=f6fda20f-681b-4fb7-8e32-e07aaae40d0a" alt=""><figcaption></figcaption></figure>

Populate all required fields with the collected information and confirm the configuration.

{% hint style="danger" %}
After clicking OK there might be a small delay, DON’T click again!
{% endhint %}

<figure><img src="https://2767179248-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSdKKJqJhW8GvhMBmgTTJ%2Fuploads%2FKcy0v37NzmMiygtsiLAL%2Fcacher_cachetracks_populate.png?alt=media&#x26;token=392ef8b6-f056-41cb-a37e-7482a4fbbb65" alt=""><figcaption></figcaption></figure>

Once the package has been processed, opening the package details should show that all URLs were successfully parsed and validated. At this stage, use the **Download zip file** option to verify that CacheR is functioning correctly and that the zip file is accessible. This download URL is also the address that must be used later for client-side reporting.

<figure><img src="https://2767179248-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSdKKJqJhW8GvhMBmgTTJ%2Fuploads%2FpPKRCFmSWCpH4oYJPBpT%2Fcacher_package_processed.png?alt=media&#x26;token=cff948ea-1eee-431f-b023-9bfacea0aec6" alt=""><figcaption></figcaption></figure>

Additionally, verify on the CacheR server that the zip file has been created in the designated **zipfiles** directory.

```
\\install path\CacheR\CacheR.Files\ZipFiles
```

### Manually configuring client side reporting

For a client to report its caching status back to CacheR, several values must be provided. These include the **Zip file URL**, which is the relative path shown under **Download File** for the package in the StifleR Dashboard, the **CacheR Secret Key** obtained from the configuration editor, the **CacheR URL**, and the **CacheR Port**, which defaults to **9050**.

Client-side reporting is performed using the **Cacher.Client.exe** command-line tool. The syntax requires specifying the CacheR endpoint, port, zip file path, CacheTrack GUID, and the secret key.&#x20;

```
Cacher.Client.exe <Cacher URL> <CacheR Port> <Zipfile relative path> <CacheTrack Guid> <CacheR Secret key>
```

Each client must execute this command for every CacheTrack it is expected to report on. To scale this process, it is recommended to distribute and execute these commands using a **Configuration Manager Configuration Item** or an **Intune Remediation Script**, ensuring consistent and automated reporting across devices.

### Automated CacheTrack Management with CacheRCIManager.ps1

For environments using Configuration Manager, the script **CacheRCIManager.ps1** provides a fully automated approach to managing CacheTracks and client-side reporting. This script synchronizes Configuration Manager packages and applications used within one or more Task Sequences into both CacheR and a single Configuration Item (CI).

The script treats the specified Task Sequence or Task Sequences as the authoritative source. Any content referenced in the Task Sequences is automatically added to CacheR and the CI. Conversely, content that no longer exists in the Task Sequences is removed from CacheR and the CI by default. This ensures long-term consistency without manual cleanup.

As a result, a single Configuration Item is created containing one compliance setting per package or application used in the specified Task Sequences. Each compliance setting runs a lightweight PowerShell detection script that invokes **Cacher.Client.exe**, allowing clients to report their caching status back to the CacheR server.

This approach guarantees that CacheR and the Configuration Item remain fully synchronized with Task Sequence changes. After updating a Task Sequence, simply re-run the script to refresh CacheTracks and reporting logic automatically.

#### **Prerequisites (must be in place before first run)**

| Prerequisite                                                                                                         | Details                                                                                                  |
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| ConfigurationManager PowerShell module (installed automatically when installing CM Admin Console)                    | $env:SMS\_ADMIN\_UI\_PATH must exist                                                                     |
| CacheR PowerShell module                                                                                             | Unzip CacheRApi.0.1.0.zip and add the unzipped folder into your PowerShell modules folder.               |
| AdminService enabled and reachable on the SMS Provider                                                               | Semi optional, only used for cleaning up old CI revisions. More housekeeping than an actual requirement. |
| A manually created (empty) Configuration Item in ConfigMgr with the exact name given in parameter -DestinationCIName | Script does NOT create the CI for you                                                                    |
| Permissions                                                                                                          | Account running the script needs full Control on the CI                                                  |

#### **Required Parameters**

| Parameter                 | Description                                                                                                                                                                  | Example                              |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| -SiteCode                 | SCCM site code                                                                                                                                                               | "P01"                                |
| -ProviderMachineName      | FQDN of SMS Provider                                                                                                                                                         | cm01.contoso.com"                    |
| -SourceTSNames            | One or more TS names (exact match)                                                                                                                                           | Windows 11 24H2", "Win11 PreCache"   |
| -DestinationCIName        | Name of the CI that will be managed                                                                                                                                          | “2Pint CacheR Update”                |
| -CacheRserver             | FQDN to CacheR Server                                                                                                                                                        | <https://cacher.contoso.com>         |
| -CacheRPort               | WebAPI port (default 9050)                                                                                                                                                   | 9050                                 |
| -CacheRApiKey             | API key configured in CacheR, found in Config Editor tool                                                                                                                    | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| -DPFQDN                   | Full https URL to a Distribution Point that CacheR can reach                                                                                                                 | <https://dp01.contoso.com>           |
| -SizeInMB                 | Minimum size of packages to track (default 1 MB)                                                                                                                             | 50                                   |
| -PrefixToSkip             | If a child TS contains content you do not want tracked by CacheR or added to the CI, name it with this prefix (default: SkipPreCache) and it will be automatically excluded. | NoPreCache"                          |
| -IgnoreContentDifferences | Keep packages/apps in CI/CacheR even if they are no longer found in TS                                                                                                       | -                                    |

#### Typical scheduled execution (example)

```
.\CacheRCIManager.ps1 -CacheRserver https://cacher-01. contoso.com -CacheRApiKey "11111111-2222-3333-4444-555555555555" -CacheRPort 9050 -ProviderMachineName "cm01.contoso.com" -SiteCode "P01" -SourceTSNames "One Task Sequence", "Another Task Sequence", "A third Task Sequence" -DestinationCIName "2Pint CacheR Update" -SizeInMB 20 -DPFQDN "https://dp01.contoso.com" 
```

Run this daily (or after every TS change) via Scheduled Task running under a service account with the required rights.
