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

# planner bucket remove

Removes the Microsoft Planner bucket from a plan

## Usage

```sh
m365 planner bucket remove [options]
```

## Options

```md definition-list
`-i, --id [id]`
: ID of the bucket to remove. Specify either `id` or `name` but not both.

`-n, --name [name]`
: Name of the bucket to remove. Specify either `id` or `name` but not both.

`--planId [planId]`
: ID of the plan to which the bucket to remove belongs. Specify either `planId`, `planTitle`, or `rosterId` but not multiple when using `name`.

`--planTitle [planTitle]`
: Title of the plan to which the bucket to remove belongs. Specify either `planId`, `planTitle`, or `rosterId` but not multiple when using `name`.

`--rosterId [rosterId]`
: ID of the Planner Roster. Specify either `planId`, `planTitle`, or `rosterId` but not multiple when using `name`.

`--ownerGroupId [ownerGroupId]`
: ID of the group to which the plan belongs. Specify either `ownerGroupId` or `ownerGroupName` when using `planTitle`.

`--ownerGroupName [ownerGroupName]`
: Name of the group to which the plan belongs. Specify either `ownerGroupId` or `ownerGroupName` when using `planTitle`.

`-f, --force`
: Don't prompt for confirmation
```

<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.ReadWrite, GroupMember.Read.All |

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

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

  </TabItem>
</Tabs>

## Examples

Removes the Microsoft Planner bucket by ID

```sh
m365 planner bucket remove --id "vncYUXCRBke28qMLB-d4xJcACtNz"
```

Removes the Microsoft Planner bucket by ID without confirmation

```sh
m365 planner bucket remove --id "vncYUXCRBke28qMLB-d4xJcACtNz" --force
```

Removes the Microsoft Planner bucket by its name based on the plan ID

```sh
m365 planner bucket remove --name "My Bucket" --planId "oUHpnKBFekqfGE_PS6GGUZcAFY7b"
```

Removes the Microsoft Planner bucket by its name based on the plan title and owner group name

```sh
m365 planner bucket remove --name "My Bucket" --planTitle "My Plan" --ownerGroupName "My Group"
```

Removes the Microsoft Planner bucket by its name based on the Roster ID

```sh
m365 planner bucket remove --name "My Bucket" --rosterId "RuY-PSpdw02drevnYDTCJpgAEfoI"
```

## Response

The command won't return a response on success.
