# Activate Process Execution At First User Logon

> Configures Windows Active Setup so a script or program is executed once for each user at their first login.

Source: https://docs.capaone.com/capaone/application-manager/powerbricks/activate-process-execution-at-first-user-logon/  
Product: CapaOne — a separate CapaSystems product; do not apply this page to any other.

Configures Windows Active Setup so a script or program is executed once for each user at their first login

## Parameters

#### File path
*Required*

Specify the destination path of the file that will be executed upon user login. Only supported formats are '.exe', '.vbs', '.cmd', '.bat', '.ps1', '.js'. If the path is $Packageroot\File.cmd the file will be copied to C:\ProgramData\CapaSystems\PowerBricks\ActiveSetup\$Key\, if the path is something else then it will be executed from the specified path

#### Arguments
*Optional*

Specify the arguments to be passed to the file upon execution. If no arguments are needed, leave this field empty

#### Description
*Optional*

Description for the Active Setup. Users will see "Setting up personalized settings for: $Description" at logon

#### Active Setup ID
*Required* — Default: `$AppName`

The unique identifier for the Active Setup entry. If you need to remove the Active Setup entry later, you will need to use the same ID

#### Execution Policy
*Optional* — Default: `Unrestricted`

Specify the execution policy for the script, if it is a PowerShell script Allowed values: `Unrestricted`, `RemoteSigned`, `AllSigned`, `Restricted`, `Bypass`.

#### Execute For Logged On User
*Optional* — Default: `True`

If a user is logged in the file will be executed for that user. For everyone the file will be executed the first time they login

## Details

- **Category:** Installer
- **Brick ID:** `ActiveSetup-Create`

## Raw JSON definition

**JSON**

```json
{
  "category": "installer",
  "description": "Configures Windows Active Setup so a script or program is executed once for each user at their first login",
  "developerVendor": "CapaSystems A/S",
  "displayName": null,
  "id": "ActiveSetup-Create",
  "name": "Activate Process Execution At First User Logon",
  "parameters": [
    {
      "allowManualInput": false,
      "defaultValue": "",
      "defaultValueObject": null,
      "description": "Specify the destination path of the file that will be executed upon user login. Only supported formats are '.exe', '.vbs', '.cmd', '.bat', '.ps1', '.js'. If the path is $Packageroot\\File.cmd the file will be copied to C:\\ProgramData\\CapaSystems\\PowerBricks\\ActiveSetup\\$Key\\, if the path is something else then it will be executed from the specified path",
      "id": "StubExePath",
      "name": "File path",
      "regExValidation": "",
      "required": true,
      "type": "TextBox",
      "value": null,
      "values": [],
      "valuesObject": null
    },
    {
      "allowManualInput": false,
      "defaultValue": "",
      "defaultValueObject": null,
      "description": "Specify the arguments to be passed to the file upon execution. If no arguments are needed, leave this field empty",
      "id": "Arguments",
      "name": "Arguments",
      "regExValidation": "",
      "required": false,
      "type": "TextBox",
      "value": null,
      "values": [],
      "valuesObject": null
    },
    {
      "allowManualInput": false,
      "defaultValue": "",
      "defaultValueObject": null,
      "description": " Description for the Active Setup. Users will see \"Setting up personalized settings for: $Description\" at logon",
      "id": "Description",
      "name": "Description",
      "regExValidation": "",
      "required": false,
      "type": "TextBox",
      "value": null,
      "values": [],
      "valuesObject": null
    },
    {
      "allowManualInput": false,
      "defaultValue": "$AppName",
      "defaultValueObject": null,
      "description": "The unique identifier for the Active Setup entry. If you need to remove the Active Setup entry later, you will need to use the same ID",
      "id": "Key",
      "name": "Active Setup ID",
      "regExValidation": "",
      "required": true,
      "type": "TextBox",
      "value": null,
      "values": [],
      "valuesObject": null
    },
    {
      "allowManualInput": false,
      "defaultValue": null,
      "defaultValueObject": {
        "id": "Unrestricted",
        "name": "Unrestricted"
      },
      "description": "Specify the execution policy for the script, if it is a PowerShell script",
      "id": "ExecutionPolicy",
      "name": "Execution Policy",
      "regExValidation": "",
      "required": false,
      "type": "ComboBox",
      "value": null,
      "values": [],
      "valuesObject": [
        {
          "id": "Unrestricted",
          "name": "Unrestricted"
        },
        {
          "id": "RemoteSigned",
          "name": "RemoteSigned"
        },
        {
          "id": "AllSigned",
          "name": "AllSigned"
        },
        {
          "id": "Restricted",
          "name": "Restricted"
        },
        {
          "id": "Bypass",
          "name": "Bypass"
        }
      ]
    },
    {
      "allowManualInput": false,
      "defaultValue": "True",
      "defaultValueObject": null,
      "description": "If a user is logged in the file will be executed for that user. For everyone the file will be executed the first time they login",
      "id": "ExecuteForCurrentUser",
      "name": "Execute For Logged On User",
      "regExValidation": "",
      "required": false,
      "type": "Boolean",
      "value": null,
      "values": [],
      "valuesObject": null
    }
  ],
  "powershell": {
    "base64Encoded": true,
    "function": "ZnVuY3Rpb2..."
  },
  "type": "powerbrick",
  "version": "2026.9.1.1"
}
```
