# Import BranchCache Secret Key

To allow DeployR to leverage the branch cache content already distributed in your environment via ConfigMgr, the branch cache server secret can be exported from your ConfigMgr DP server, and imported into DeployR.

A couple of PowerShell functions have been created for this process

* 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 over then Import

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

<figure><img src="https://744643921-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJO9NLelA0RS8JB4i9oaQ%2Fuploads%2FQPJmMkiWbQJWSexXELaT%2Fimage.png?alt=media&#x26;token=0e4cf7b4-c741-43bc-9732-e4f6f21d479a" alt=""><figcaption></figcaption></figure>

To Confirm, you can look at the Registry.  HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\SecurityManager\Restricted

Below is a capture of the Registry Value after the import of the secret key on the DeployR server, the values match so we know the import worked. &#x20;

<figure><img src="https://744643921-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJO9NLelA0RS8JB4i9oaQ%2Fuploads%2FyMFaCNvGiT1hVEJj7QiV%2Fimage.png?alt=media&#x26;token=639c198a-ad2f-4690-b1fe-eeac7faa5e6c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://744643921-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJO9NLelA0RS8JB4i9oaQ%2Fuploads%2Fvo8ci3Ki4IreX77ij2tC%2Fimage.png?alt=media&#x26;token=01f38537-1505-471f-a3d5-67197693d91d" alt=""><figcaption></figcaption></figure>

### Reset DeployR BC Hash CIs

Once the import is done, DeployR will now use 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 area, you'll see several precreated items, once there, do a search for \*.genci

<figure><img src="https://744643921-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJO9NLelA0RS8JB4i9oaQ%2Fuploads%2FRjsDt9fdCeaS2aXNsqgZ%2Fimage.png?alt=media&#x26;token=ea4840f8-62a0-4686-80c1-02f6702fef46" alt=""><figcaption></figcaption></figure>

<figure><img src="https://744643921-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJO9NLelA0RS8JB4i9oaQ%2Fuploads%2FcD5QIGmy6S2vkaC7Mahj%2Fimage.png?alt=media&#x26;token=7fb7cb17-ba63-4ba6-b1eb-8de14c980d64" alt=""><figcaption></figcaption></figure>

Confirm all of the items it finds are .genci files, then select all and delete

<figure><img src="https://744643921-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJO9NLelA0RS8JB4i9oaQ%2Fuploads%2F12wO7AzOA9w6oGuac963%2Fimage.png?alt=media&#x26;token=e2a36b8a-9254-4161-aad1-336e50ad912e" 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 Branch Cache, improving your P2P efficiencies.&#x20;
