> For the complete documentation index, see [llms.txt](https://documentation.2pintsoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.2pintsoftware.com/deployr/integrations/peering-and-content-basics/import-branchcache-secret-key.md).

# Import BranchCache Secret Key

When moving from ConfigMgr, or working alongside it, there is a benefit to having the DeployR server share the same BranchCache secret key in both environments.

To let DeployR use BranchCache content already distributed through ConfigMgr, export the BranchCache secret from your ConfigMgr distribution point (DP) server and import it into DeployR.

Use the following PowerShell functions:

* Export: [Export-BCSecretKey](https://learn.microsoft.com/en-us/powershell/module/branchcache/export-bcsecretkey)
* Import: [Import-BCSecretKey](https://learn.microsoft.com/en-us/powershell/module/branchcache/import-bcsecretkey)

### Export & Import Key

On the ConfigMgr DP, export the key:

```powershell
Export-BCSecretKey -Filename c:\BCSuperSecret.key -FilePassphrase SUPERSECRETPHRASE
```

On the DeployR server, copy the file and import the key:

```powershell
Import-BCSecretKey -Filename D:\BCSuperSecret.key -FilePassphrase SUPERSECRETPHRASE
```

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/2R8lUb77pxgKdUtvWXaj/image.png" alt=""><figcaption></figcaption></figure>

To confirm the import, check the registry. HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\SecurityManager\Restricted

Below is a capture of the registry value after importing the secret key on the DeployR server. The values match, so the import worked.

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/52LljuwjX5rZV4eSJvtx/image.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/q6dHFNx6EATWSck6KNu9/image.png" alt=""><figcaption></figcaption></figure>

### Reset DeployR BC Hash CIs

Once the import is done, DeployR uses the new secret to create hashes, but any content already used in DeployR will already have hashes generated with the old secret. Those all need to be deleted so they will be regenerated the next time their associated content items are called by DeployR.

On the DeployR server, go to the DeployR content folder, which contains several precreated items, and search for \*.genci.

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/L6q0LgHC6OF1cStL8W3p/image.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/9pgm2Y1Rey0S6gG3Udye/image.png" alt=""><figcaption></figcaption></figure>

Confirm that all of the items found are .genci files, then select them all and delete them.

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/rUiFr6gn1hrrpYJaeSqI/image.png" alt=""><figcaption></figcaption></figure>

The files will regenerate the next time the content is used by DeployR.

Now DeployR & ConfigMgr content will be shared back and forth using BranchCache, improving your P2P efficiencies.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.2pintsoftware.com/deployr/integrations/peering-and-content-basics/import-branchcache-secret-key.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
