Skip to content

New command: spo site recyclebinitem clear #4724

@milanholemans

Description

@milanholemans

Usage

m365 spo site recyclebinitem clear [options]

Description

Permanently removes all items in a site recycle bin

Options

Option Description
-u, --siteUrl <siteUrl> URL of the site where the recycle bin is located.
--secondary Remove all items from the second-stage recycle bin. When not specified, items from the first-stage recycle bin will be cleared.
--confirm Don't prompt for confirmation.

Examples

Clear all items from the first-stage recycle bin

m365 spo site recyclebinitem clear --siteUrl https://contoso.sharepoint.com/sites/sales

Clear all items from the second-stage recycle bin

m365 spo site recyclebinitem clear --siteUrl https://contoso.sharepoint.com/sites/sales --secondary

Default properties

No response

Additional Info

Originates from #4694

API requests

Clear all first-stage items:

POST https://tenant.sharepoint.com/sites/project-x/_api/web/recycleBin/DeleteAll

Clear all 2nd stage items:
(Currently having issues to make this request work)

POST https://tenant.sharepoint.com/sites/project-x/_api/web/recycleBin/DeleteAllSecondStageItems

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions