# org assign permsetlicense

Assign a permission set license to one or more org users.

## Description for org assign permsetlicense

To specify an alias for the --target-org or --on-behalf-of flags, use the CLI username alias, such as the one you set with the "alias set" command. Don't use the value of the Alias field of the User Salesforce object for the org user.

To assign multiple permission sets, either set multiple --name flags or a single --name flag with multiple names separated by spaces. Enclose names that contain spaces in one set of double quotes. The same syntax applies to --on-behalf-of.

## Flags

| Flag Name (Long) | Flag Name (Short) | Description                                                                                                                                         |
| ---------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--api-version`  | N/A               | **Type:** Value<br><br>Override the api version used for api requests made by this command                                                          |
| `--flags-dir`    | N/A               | **Type:** Value<br><br>Import flag values from a directory.                                                                                         |
| `--json`         | N/A               | **Type:** Boolean<br><br>Format output as json.                                                                                                     |
| `--name`         | `-n`              | **Type:** Value<br>**Required**<br><br>Name of the permission set license to assign.                                                                |
| `--on-behalf-of` | `-b`              | **Type:** Value<br><br>Usernames or alias to assign the permission set license to.                                                                  |
| `--target-org`   | `-o`              | **Type:** Value<br>**Required**<br><br>Username or alias of the target org. Not required if the `target-org` configuration variable is already set. |

## Examples for org assign permsetlicense

Assign the DreamHouse permission set license to original admin user of your default org:

```shell
sf org assign permsetlicense --name DreamHouse
```

Assign two permission set licenses to the original admin user of the org with alias "my-scratch":

```shell
sf org assign permsetlicense --name DreamHouse --name CloudHouse --target-org my-scratch
```

Assign the Dreamhouse permission set license to the specified list of users of your default org:

```shell
sf org assign permsetlicense --name DreamHouse --on-behalf-of user1@my.org --on-behalf-of user2 --on-behalf-of user3
```
