# Assign Groups By Template

### Description

Adds a user to one or more Entra ID groups using either group object IDs or display names. The list of groups is typically provided via runbook customization templates.

### Location

User → General → Assign Groups By Template

**Full Runbook name**

rjgit-user\_general\_assign-groups-by-template

### Permissions

#### Application permissions

* **Type**: Microsoft Graph
  * Group.ReadWrite.All

### Parameters

#### UserId

ID of the target user in Microsoft Graph.

| Property      | Value  |
| ------------- | ------ |
| Required      | true   |
| Default Value |        |
| Type          | String |

#### GroupsTemplate

Template selector used by portal customization to populate the group list.

| Property      | Value  |
| ------------- | ------ |
| Required      | false  |
| Default Value |        |
| Type          | String |

#### GroupsString

Comma-separated list of group object IDs or group display names.

| Property      | Value  |
| ------------- | ------ |
| Required      | true   |
| Default Value |        |
| Type          | String |

#### UseDisplaynames

If set to true, treats values in GroupsString as group display names instead of IDs.

| Property      | Value   |
| ------------- | ------- |
| Required      | false   |
| Default Value | True    |
| Type          | Boolean |

[Back to Runbook Reference overview](/automation/runbooks/runbook-references.md)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.realmjoin.com/automation/runbooks/runbook-references/user/general/assign-groups-by-template.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
