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

# spo site recyclebinitem list

Lists items from recycle bin

## Usage

```sh
m365 spo site recyclebinitem list [options]
```

## Options

```md definition-list
`-u, --siteUrl <siteUrl>`
: URL of the site for which to retrieve the recycle bin items

`--type [type]`
: Type of items which should be retrieved. Valid values: `listItems`, `folders`, `files`.

`--secondary`
: Use this switch to retrieve items from secondary recycle bin
```

<Global />

## Remarks

When type is not specified then the command will return all items in the recycle bin

## Examples

Lists all files, items and folders from recycle bin for site _https://contoso.sharepoint.com/site_

```sh
m365 spo site recyclebinitem list --siteUrl https://contoso.sharepoint.com/site
```

Lists only files from recycle bin for site _https://contoso.sharepoint.com/site_

```sh
m365 spo site recyclebinitem list --siteUrl https://contoso.sharepoint.com/site --type files
```

## Response

<Tabs>
  <TabItem value="JSON">

  ```json
  [
    {
      "AuthorEmail": "john@contoso.onmicrosoft.com",
      "AuthorName": "John",
      "DeletedByEmail": "john@contoso.onmicrosoft.com",
      "DeletedByName": "John",
      "DeletedDate": "2023-04-20T20:02:08Z",
      "DeletedDateLocalFormatted": "4/20/2023 1:02 PM",
      "DirName": "Lists/Sales",
      "DirNamePath": {
        "DecodedUrl": "Lists/Sales"
      },
      "Id": "7709661a-2923-44d1-8200-5e0e4a625ce7",
      "ItemState": 1,
      "ItemType": 3,
      "LeafName": "2_.000",
      "LeafNamePath": {
        "DecodedUrl": "2_.000"
      },
      "Size": "196",
      "Title": "Test"
    }
  ]
  ```

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

  ```text
  Id                                    Title                                       DirName
  ------------------------------------  ------------------------------------------  ---------------------
  7709661a-2923-44d1-8200-5e0e4a625ce7  Test                                        Lists/Sales
  ```

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

  ```csv
  AuthorEmail,AuthorName,DeletedByEmail,DeletedByName,DeletedDate,DeletedDateLocalFormatted,DirName,Id,ItemState,ItemType,LeafName,Size,Title
  john@contoso.onmicrosoft.com,John,john@contoso.onmicrosoft.com,John,2023-04-20T20:02:08Z,4/20/2023 1:02 PM,Lists/Sales,7709661a-2923-44d1-8200-5e0e4a625ce7,1,3,2_.000,196,Test
  ```

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

  ```md
  # spo site recyclebinitem list --siteUrl "https://contoso.sharepoint.com/"

  Date: 2023-06-21

  ## Test (7709661a-2923-44d1-8200-5e0e4a625ce7)

  Property | Value
  ---------|-------
  AuthorEmail | john@contoso.onmicrosoft.com
  AuthorName | John
  DeletedByEmail | john@contoso.onmicrosoft.com
  DeletedByName | John
  DeletedDate | 2023-04-20T20:02:08Z
  DeletedDateLocalFormatted | 4/20/2023 1:02 PM
  DirName | Lists/Sales
  Id | 7709661a-2923-44d1-8200-5e0e4a625ce7
  ItemState | 1
  ItemType | 3
  LeafName | 2\_.000
  Size | 196
  Title | Test
  ```

  </TabItem>
</Tabs>
