> For the complete documentation index, see [llms.txt](https://docs.realmjoin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmjoin.com/automation/runbooks/runbook-references/org/general/add-office365-group.md).

# Add Office365 Group

Create a Microsoft 365 group, optionally with a team

### Description

Creates a Microsoft 365 group with its SharePoint site and, on request, turns it into a Microsoft Teams team. Visibility, mail and security settings and up to two owners can be set. A team without an owner gets the caller as owner.

### Location

Organization → General → Add Office365 Group

**Full Runbook name**

rjgit-org\_general\_add-office365-group

### Details

| Property         | Value                               |
| ---------------- | ----------------------------------- |
| Version          | 1.0.1                               |
| Required modules | RealmJoin.RunbookHelper (>= 0.8.10) |
| Schedulable      | no                                  |

### Permissions

#### Application permissions

* **Type**: Microsoft Graph
  * Group.Create
    * *Creates the new Microsoft 365 group with visibility, mail settings and owner/member bindings*
  * Team.Create
    * *Promotes the group to a Teams team when CreateTeam is enabled*
  * Group.Read.All
    * *Checks for an existing group with the same mail nickname before creating*
  * User.Read.All *(optional — feature: Owner assignment)*
    * *Resolves the owner users via /users/{upn} when owners are provided*

### Parameters

#### MailNickname

Alias of the group, used for its email address and SharePoint URL.

| Property            | Value         |
| ------------------- | ------------- |
| Required            | true          |
| Default Value       |               |
| Type                | String        |
| Portal display name | Mail nickname |

#### DisplayName

Name shown for the group. Leave empty to use the mail nickname.

| Property            | Value        |
| ------------------- | ------------ |
| Required            | false        |
| Default Value       |              |
| Type                | String       |
| Portal display name | Display name |

#### CreateTeam

Creates only the group with its SharePoint site, or also a Microsoft Teams team on top of it.

| Property            | Value                |
| ------------------- | -------------------- |
| Required            | false                |
| Default Value       | False                |
| Type                | Boolean              |
| Portal display name | Create a Teams team? |

**Portal options**

| Portal option                           | Value |
| --------------------------------------- | ----- |
| Only the group with its SharePoint site | false |
| Also a Microsoft Teams team             | true  |

#### Private

Public groups can be found and joined by anyone in the organization, private groups only by their members.

| Property            | Value      |
| ------------------- | ---------- |
| Required            | false      |
| Default Value       | False      |
| Type                | Boolean    |
| Portal display name | Visibility |

**Portal options**

| Portal option | Value |
| ------------- | ----- |
| Public        | false |
| Private       | true  |

#### MailEnabled

Gives the group a mailbox and email address.

| Property            | Value         |
| ------------------- | ------------- |
| Required            | false         |
| Default Value       | False         |
| Type                | Boolean       |
| Portal display name | Mail-enabled? |

#### SecurityEnabled

Lets the group be used for permissions and access assignments.

| Property            | Value             |
| ------------------- | ----------------- |
| Required            | false             |
| Default Value       | True              |
| Type                | Boolean           |
| Portal display name | Security-enabled? |

#### Owner

Owner of the group. Leave empty for none; a team then gets the caller as owner.

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

#### Owner2

Additional owner. Leave empty for none.

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

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.realmjoin.com/automation/runbooks/runbook-references/org/general/add-office365-group.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
