# Set Default File Associations

> Sets the default application associations on a Windows device, either from an association file exported from a reference device or from a single file extension you type.

Source: https://docs.capaone.com/capaone/application-manager/powerbricks/bricks/set-default-file-associations/  
Product: CapaOne — a separate CapaSystems product; do not apply this page to any other.

Sets the default application associations on a Windows device, either from an association file exported from a reference device or from a single file extension you type in.\\n\\nA single file extension is added to the default associations the device already has, so the default apps for every other file type are kept. An association file is applied as the complete set of default associations for the device.\\n\\nIMPORTANT: Default application associations only apply to user profiles that are created AFTER this brick has run. Users who have already logged on to the device keep their current default apps and are not changed by this brick. Use this brick during provisioning of new devices.\\n\\nExport an association file from a reference device with:\\ndism /Online /Export-DefaultAppAssociations:C:\\Temp\\Associations.xml\\n\\nRemember to include the [Download Content] PowerBrick when the association file is referenced with $PackageRoot.

## Parameters

#### Source
*Required* — Default: `Association XML File`

Choose where the default associations come from.\\n\\nAssociation XML File: use a complete association file exported from a reference device. It is applied as the complete set of default associations for the device. Fill in Association File Path.\\n\\nSingle Association: set the default app for one file extension only. The extension is added to the default associations the device already has, so the default apps for every other file type are kept. Fill in Extension, Program Identifier and Application Name.\\n\\nOnly the fields belonging to the selected source are used - the other fields are ignored. Allowed values: `Association XML File`, `Single Association`.

#### Association File Path
*Optional* — Default: `$PackageRoot\Associations.xml`

Only used when the source is Association XML File. The full path to the association file that should be applied. Create the file on a reference device where the default apps are already set the way you want them, then include it in the package.\\n\\nExport it with:\\ndism /Online /Export-DefaultAppAssociations:C:\\Temp\\Associations.xml\\n\\nExample: $PackageRoot\\Associations.xml\\n\\nRemember to include the [Download Content] PowerBrick when using $PackageRoot. The brick stops with an error if the file is missing or is not a valid association file.\\n\\nNote that the associations in the file only take effect for users created after this brick has run.

#### Extension
*Optional*

Only used when the source is Single Association. The file name extension that should get a new default application. The leading dot is optional - both .pdf and pdf are accepted.\\n\\nExamples:\\n.pdf\\n.htm\\n.txt\\n\\nOnly this extension is changed. It is added to the default associations the device already has, and if the device already has a default app for the extension it is replaced.\\n\\nNote that the association only takes effect for users created after this brick has run.

#### Program Identifier
*Optional*

Only used when the source is Single Association. The program identifier of the application that should open the extension. This is the internal Windows identifier for the application, not the file path.\\n\\nOnly the extension in Extension is pointed at this application. The default apps the device already has for other file types are kept.\\n\\nExamples:\\nAcroExch.Document.DC\\nChromeHTML\\nMSEdgePDF\\n\\nFind the correct value by exporting the associations from a reference device where the default app is already set:\\ndism /Online /Export-DefaultAppAssociations:C:\\Temp\\Associations.xml\\n\\nA wrong value is accepted by Windows but silently gives the user no working default app.

#### Application Name
*Optional*

Only used when the source is Single Association. The display name of the application, as it appears in the exported association file. It is only used for readability and can be left empty.\\n\\nExamples:\\nAdobe Acrobat Reader\\nGoogle Chrome

#### Validate File Only
*Optional* — Default: `False`

Leave disabled to import the associations on the device. This is the normal setting.\\n\\nEnable to only check that the association file is valid and then stop without changing anything on the device. Nothing is imported. This is useful for testing an association file before rolling it out.\\n\\nIn both cases, users who have already logged on to the device keep their current default apps - this brick can only set the defaults for user profiles created afterwards.

#### Log File Name
*Optional* — Default: `Windows_Default_Associations_Set.log`

Name of the log file written to the package log folder - ex. Windows_Default_Associations_Set.log. Give each Set Default File Associations brick in the same workflow its own name to keep the logs apart.

## Details

- **Category:** Provisioning
- **Brick ID:** `Windows-Default-Associations-Set`

## Raw JSON definition

```json
{
  "category": "provisioning",
  "description": "Sets the default application associations on a Windows device, either from an association file exported from a reference device or from a single file extension you type in.\\n\\nA single file extension is added to the default associations the device already has, so the default apps for every other file type are kept. An association file is applied as the complete set of default associations for the device.\\n\\nIMPORTANT: Default application associations only apply to user profiles that are created AFTER this brick has run. Users who have already logged on to the device keep their current default apps and are not changed by this brick. Use this brick during provisioning of new devices.\\n\\nExport an association file from a reference device with:\\ndism /Online /Export-DefaultAppAssociations:C:\\Temp\\Associations.xml\\n\\nRemember to include the [Download Content] PowerBrick when the association file is referenced with $PackageRoot.",
  "developerVendor": "CapaSystems A/S",
  "displayName": null,
  "id": "Windows-Default-Associations-Set",
  "name": "Set Default File Associations",
  "parameters": [
    {
      "allowManualInput": false,
      "defaultValue": null,
      "defaultValueObject": {
        "id": "XmlFile",
        "name": "Association XML File"
      },
      "description": "Choose where the default associations come from.\\n\\nAssociation XML File: use a complete association file exported from a reference device. It is applied as the complete set of default associations for the device. Fill in Association File Path.\\n\\nSingle Association: set the default app for one file extension only. The extension is added to the default associations the device already has, so the default apps for every other file type are kept. Fill in Extension, Program Identifier and Application Name.\\n\\nOnly the fields belonging to the selected source are used - the other fields are ignored.",
      "id": "Source",
      "name": "Source",
      "regExValidation": "",
      "required": true,
      "type": "ComboBox",
      "value": null,
      "values": [],
      "valuesObject": [
        {
          "id": "XmlFile",
          "name": "Association XML File"
        },
        {
          "id": "SingleAssociation",
          "name": "Single Association"
        }
      ]
    },
    {
      "allowManualInput": false,
      "defaultValue": "$PackageRoot\\Associations.xml",
      "defaultValueObject": null,
      "description": "Only used when the source is Association XML File. The full path to the association file that should be applied. Create the file on a reference device where the default apps are already set the way you want them, then include it in the package.\\n\\nExport it with:\\ndism /Online /Export-DefaultAppAssociations:C:\\Temp\\Associations.xml\\n\\nExample: $PackageRoot\\Associations.xml\\n\\nRemember to include the [Download Content] PowerBrick when using $PackageRoot. The brick stops with an error if the file is missing or is not a valid association file.\\n\\nNote that the associations in the file only take effect for users created after this brick has run.",
      "id": "AssociationsFilePath",
      "name": "Association File Path",
      "regExValidation": "",
      "required": false,
      "type": "TextBox",
      "value": null,
      "values": [],
      "valuesObject": null
    },
    {
      "allowManualInput": false,
      "defaultValue": "",
      "defaultValueObject": null,
      "description": "Only used when the source is Single Association. The file name extension that should get a new default application. The leading dot is optional - both .pdf and pdf are accepted.\\n\\nExamples:\\n.pdf\\n.htm\\n.txt\\n\\nOnly this extension is changed. It is added to the default associations the device already has, and if the device already has a default app for the extension it is replaced.\\n\\nNote that the association only takes effect for users created after this brick has run.",
      "id": "Extension",
      "name": "Extension",
      "regExValidation": "^\\.?[A-Za-z0-9][A-Za-z0-9._+\\-]*$",
      "required": false,
      "type": "TextBox",
      "value": null,
      "values": [],
      "valuesObject": null
    },
    {
      "allowManualInput": false,
      "defaultValue": "",
      "defaultValueObject": null,
      "description": "Only used when the source is Single Association. The program identifier of the application that should open the extension. This is the internal Windows identifier for the application, not the file path.\\n\\nOnly the extension in Extension is pointed at this application. The default apps the device already has for other file types are kept.\\n\\nExamples:\\nAcroExch.Document.DC\\nChromeHTML\\nMSEdgePDF\\n\\nFind the correct value by exporting the associations from a reference device where the default app is already set:\\ndism /Online /Export-DefaultAppAssociations:C:\\Temp\\Associations.xml\\n\\nA wrong value is accepted by Windows but silently gives the user no working default app.",
      "id": "ProgId",
      "name": "Program Identifier",
      "regExValidation": "",
      "required": false,
      "type": "TextBox",
      "value": null,
      "values": [],
      "valuesObject": null
    },
    {
      "allowManualInput": false,
      "defaultValue": "",
      "defaultValueObject": null,
      "description": "Only used when the source is Single Association. The display name of the application, as it appears in the exported association file. It is only used for readability and can be left empty.\\n\\nExamples:\\nAdobe Acrobat Reader\\nGoogle Chrome",
      "id": "ApplicationName",
      "name": "Application Name",
      "regExValidation": "",
      "required": false,
      "type": "TextBox",
      "value": null,
      "values": [],
      "valuesObject": null
    },
    {
      "allowManualInput": false,
      "defaultValue": "False",
      "defaultValueObject": null,
      "description": "Leave disabled to import the associations on the device. This is the normal setting.\\n\\nEnable to only check that the association file is valid and then stop without changing anything on the device. Nothing is imported. This is useful for testing an association file before rolling it out.\\n\\nIn both cases, users who have already logged on to the device keep their current default apps - this brick can only set the defaults for user profiles created afterwards.",
      "id": "ValidateFileOnly",
      "name": "Validate File Only",
      "regExValidation": "",
      "required": false,
      "type": "Boolean",
      "value": null,
      "values": [],
      "valuesObject": null
    },
    {
      "allowManualInput": false,
      "defaultValue": "Windows_Default_Associations_Set.log",
      "defaultValueObject": null,
      "description": "Name of the log file written to the package log folder - ex. Windows_Default_Associations_Set.log. Give each Set Default File Associations brick in the same workflow its own name to keep the logs apart.",
      "id": "LogFileName",
      "name": "Log File Name",
      "regExValidation": "",
      "required": false,
      "type": "TextBox",
      "value": null,
      "values": [],
      "valuesObject": null
    }
  ],
  "powershell": {
    "base64Encoded": true,
    "function": "ZnVuY3Rpb2..."
  },
  "type": "powerbrick",
  "version": "2026.10.8.1"
}
```
