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

# planner roster plan list

Lists all Microsoft Planner Roster plans for a specific user

## Usage

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

## Options

```md definition-list
`--userId [userId]`
: User's Microsoft Entra ID. Specify either `userId` or `userName` but not both. Specify this option only when using application permissions.

`--userName [userName]`
: User's UPN (user principal name, e.g. johndoe@example.com). Specify either `userId` or `userName` but not both. Specify this option only when using application permissions.
```

<Global />

## Remarks

:::warning

This 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  |

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

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

  </TabItem>
</Tabs>

## Examples

List all Planner plans contained in a Roster where the current logged in user is member of.

```sh
m365 planner roster plan list
```

List all Planner plans contained in a Roster where specific user is member of by its UPN.

```sh
m365 planner roster plan list --userName john.doe@contoso.com
```

List all Planner plans contained in a Roster where specific user is member of by its Id.

```sh
m365 planner roster plan list --userId 59f80e08-24b1-41f8-8586-16765fd830d3
```

## Response

<Tabs>
  <TabItem value="JSON">

  ```json
  [
    {
      "createdDateTime": "2023-04-06T14:41:49.8676617Z",
      "owner": "59f80e08-24b1-41f8-8586-16765fd830d3",
      "title": "My Planner Plan",
      "creationSource": null,
      "id": "_5GY9MJpZU2vb3DC46CP3MkACr8m",
      "createdBy": {
        "user": {
          "displayName": null,
          "id": "59f80e08-24b1-41f8-8586-16765fd830d3"
        },
        "application": {
          "displayName": null,
          "id": "31359c7f-bd7e-475c-86db-fdb8c937548e"
        }
      },
      "container": {
        "containerId": "_5GY9MJpZU2vb3DC46CP3MkACr8m",
        "type": "unknownFutureValue",
        "url": "https://graph.microsoft.com/beta/planner/rosters/_5GY9MJpZU2vb3DC46CP3MkACr8m"
      },
      "contexts": {},
      "sharedWithContainers": []
    }
  ]
  ```

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

  ```text
  id                            title            createdDateTime               owner
  ----------------------------  ---------------  ----------------------------  ------------------------------------
  _5GY9MJpZU2vb3DC46CP3MkACr8m  My Planner Plan  2023-04-06T14:41:49.8676617Z  59f80e08-24b1-41f8-8586-16765fd830d3
  ```

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

  ```csv
  createdDateTime,owner,title,id
  2023-04-06T14:41:49.8676617Z,59f80e08-24b1-41f8-8586-16765fd830d3,My Planner Plan,_5GY9MJpZU2vb3DC46CP3MkACr8m
  ```

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

  ```md
  # planner roster plan list --userId "59f80e08-24b1-41f8-8586-16765fd830d3"

  Date: 4/8/2023

  ## My Planner Plan (_5GY9MJpZU2vb3DC46CP3MkACr8m)

  Property | Value
  ---------|-------
  createdDateTime | 2023-04-06T14:41:49.8676617Z
  owner | 59f80e08-24b1-41f8-8586-16765fd830d3
  title | My Planner Plan
  id | \_5GY9MJpZU2vb3DC46CP3MkACr8m
  ```

  </TabItem>
</Tabs>

