Skip to main content

teams team add

Adds a new Microsoft Teams team

Usage

m365 teams team add [options]

Options

-n, --name [name]

Display name for the Microsoft Teams team. Required if template not supplied.

-d, --description [description]

Description for the Microsoft Teams team. Required if template not supplied.

--template [template]

Template to use to create the team. If name or description are supplied, these take precedence over the template values.

--wait

Wait for the team to be provisioned before completing the command.

--ownerUserNames [ownerUserNames]

User principal names of the owners to set, separated by a ,. Specify either ownerUserNames, ownerIds or ownerEmails.

--ownerIds [ownerIds]

Ids of the owners to set, separated by a ,. Specify either ownerUserNames, ownerIds or ownerEmails.

--ownerEmails [ownerEmails]

Email addresses of the owners to set, separated by a ,. Specify either ownerUserNames, ownerIds or ownerEmails.

--memberUserNames [memberUserNames]

User principal names of the members to set, separated by a ,. Specify either memberUserNames, memberIds or memberEmails.

--memberIds [memberIds]

Ids of the members to set, separated by a ,. Specify either memberUserNames, memberIds or memberEmails.

--memberEmails [memberEmails]

Email addresses of the members to set, separated by a ,. Specify either memberUserNames, memberIds or memberEmails.

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks

If you want to add a Team to an existing Microsoft 365 Group use the entra m365group teamify command instead.

This command will return different responses based on the presence of the --wait option. If present, the command will return a group resource in the response. If not present, the command will return a teamsAsyncOperation resource in the response.

info

When using application permissions, you have to specify atleast one owner using the --ownerUserNames, --ownerIds or --ownerEmails options. This will also result in the --wait option being enforced if more than one owner is being set.

Examples

Add a new Microsoft Teams team with a specific owner.

m365 teams team add --name "Architecture" --description "Architecture Discussion" --ownerIds "d7a3d3e5-3e3d-4f3e-8a3d-3e3d3f3e3d3f"

Add a new Microsoft Teams team using a template from a file.

m365 teams team add --name "Architecture" --description "Architecture Discussion" --template @template.json

Add a new Microsoft Teams team using a template and wait for the team to be provisioned with multiple members.

m365 teams team add --name "Architecture" --description "Architecture Discussion" --template @template.json --wait --memberUserNames "john@contoso.com,doe@contoso.com"

Response

Standard response

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams('a40210cd-0060-4b91-aaa1-a44e0853d979')/operations/$entity",
"id": "d708ecb3-3325-4f6e-a0f7-2f982901b856",
"operationType": "createTeam",
"createdDateTime": "2022-10-31T12:50:44.0819314Z",
"status": "notStarted",
"lastActionDateTime": "2022-10-31T12:50:44.0819314Z",
"attemptsCount": 1,
"targetResourceId": "a40210cd-0060-4b91-aaa1-a44e0853d979",
"targetResourceLocation": "/teams('a40210cd-0060-4b91-aaa1-a44e0853d979')",
"Value": "{\"apps\":[],\"channels\":[],\"WorkflowId\":\"westeurope.0837160b-803e-4279-9f2c-a5cc46ffc748\"}",
"error": null
}

wait response

When we make use of the option wait the response will differ.

{
"id": "d592059d-100f-48c6-8a91-b68eec00ecec",
"deletedDateTime": null,
"classification": null,
"createdDateTime": "2022-11-04T12:46:47Z",
"creationOptions": [
"Team",
"ExchangeProvisioningFlags:3552"
],
"description": "Architecture Discussion",
"displayName": "Architecture",
"expirationDateTime": null,
"groupTypes": [
"Unified"
],
"isAssignableToRole": null,
"mail": "Architecture@contoso.onmicrosoft.com",
"mailEnabled": true,
"mailNickname": "Architecture",
"membershipRule": null,
"membershipRuleProcessingState": null,
"onPremisesDomainName": null,
"onPremisesLastSyncDateTime": null,
"onPremisesNetBiosName": null,
"onPremisesSamAccountName": null,
"onPremisesSecurityIdentifier": null,
"onPremisesSyncEnabled": null,
"preferredDataLocation": null,
"preferredLanguage": null,
"proxyAddresses": [
"SMTP:Architecture@contoso.onmicrosoft.com"
],
"renewedDateTime": "2022-11-04T12:46:47Z",
"resourceBehaviorOptions": [
"HideGroupInOutlook",
"SubscribeMembersToCalendarEventsDisabled",
"WelcomeEmailDisabled"
],
"resourceProvisioningOptions": [
"Team"
],
"securityEnabled": false,
"securityIdentifier": "S-1-12-1-3583116701-1220939791-2394329482-3974889708",
"theme": null,
"visibility": "Public",
"onPremisesProvisioningErrors": []
}

More information

CTRL + M