import Global from '../../_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# planner plan list

Returns a list of plans associated with a specified group

## Usage

```sh
m365 planner plan list [options]
```

## Options

```md definition-list
`--ownerGroupId [ownerGroupId]`
: ID of the Group that owns the plan. Specify either `ownerGroupId`, `ownerGroupName` or `rosterId`.

`--ownerGroupName [ownerGroupName]`
: Name of the Group that owns the plan. Specify either `ownerGroupId`, `ownerGroupName` or `rosterId`.

`--rosterId [rosterId]`
: ID of the Planner Roster. Specify either `ownerGroupId`, `ownerGroupName` or `rosterId`.
```

<Global />

## Remarks

:::warning

When using rosterId, the command is based on an API that is currently in preview and is subject to change once the API reached general availability.

:::

## Permissions

<Tabs>
  <TabItem value="Delegated">

  | Resource        | Permissions                      |
  |-----------------|----------------------------------|
  | Microsoft Graph | Tasks.Read, GroupMember.Read.All |

  </TabItem>
  <TabItem value="Application">

  | Resource        | Permissions                          |
  |-----------------|--------------------------------------|
  | Microsoft Graph | Tasks.Read.All, GroupMember.Read.All |

  </TabItem>
</Tabs>

## Examples

Returns a list of Microsoft Planner plans for the specified Group by id.

```sh
m365 planner plan list --ownerGroupId "233e43d0-dc6a-482e-9b4e-0de7a7bce9b4"
```

Returns a list of Microsoft Planner plans for the specified Group by name.

```sh
m365 planner plan list --ownerGroupName "My Planner Group"
```

Returns a list of Microsoft Planner plans for the specified Roster.

```sh
m365 planner plan list --rosterId "FeMZFDoK8k2oWmuGE-XFHZcAEwtn"
```

## Response

<Tabs>
  <TabItem value="JSON">

  ```json
  [
    {
      "createdDateTime": "2015-03-30T18:36:49.2407981Z",
      "owner": "ebf3b108-5234-4e22-b93d-656d7dae5874",
      "title": "My Planner Plan",
      "id": "xqQg5FS2LkCp935s-FIFm2QAFkHM",
      "createdBy": {
        "user": {
          "displayName": null,
          "id": "95e27074-6c4a-447a-aa24-9d718a0b86fa"
        },
        "application": {
          "displayName": null,
          "id": "ebf3b108-5234-4e22-b93d-656d7dae5874"
        }
      },
      "container": {
        "containerId": "ebf3b108-5234-4e22-b93d-656d7dae5874",
        "type": "group",
        "url": "https://graph.microsoft.com/v1.0/groups/ebf3b108-5234-4e22-b93d-656d7dae5874"
      }
    }
  ]
  ```

  </TabItem>
  <TabItem value="Text">

  ```text
  id                            title            createdDateTime               owner
  ----------------------------  ---------------  ----------------------------  ------------------------------------
  xqQg5FS2LkCp935s-FIFm2QAFkHM  My Planner Plan  2015-03-30T18:36:49.2407981Z  ebf3b108-5234-4e22-b93d-656d7dae5874
  ```

  </TabItem>
  <TabItem value="CSV">

  ```csv
  id,title,createdDateTime,owner
  xqQg5FS2LkCp935s-FIFm2QAFkHM,My Planner Plan,2015-03-30T18:36:49.2407981Z,ebf3b108-5234-4e22-b93d-656d7dae5874
  ```

  </TabItem>
  <TabItem value="Markdown">

  ```md
  # planner plan list --ownerGroupId "ebf3b108-5234-4e22-b93d-656d7dae5874"

  Date: 27/12/2022

  ## My Planner Plan (xqQg5FS2LkCp935s-FIFm2QAFkHM)

  Property | Value
  ---------|-------
  createdDateTime | 2021-12-12T14:00:50.4522129Z
  owner | ebf3b108-5234-4e22-b93d-656d7dae5874
  title | My Planner Plan
  id | xqQg5FS2LkCp935s-FIFm2QAFkHM
  ```

  </TabItem>
</Tabs>
