Skip to content

New command: m365 spo file sharinglink clear #4028

@MathijsVerbeeck

Description

@MathijsVerbeeck

Usage

m365 spo file sharinglink clear

Description

Removes all sharing links of a file

Options

Option Description
-w, --webUrl <webUrl> The URL of the site where the file is located
-u, --fileUrl [fileUrl] The server-relative (decoded) URL of the file. Specify either fileUrl or fileId but not both
-i, --fileId [fileId] The UniqueId (GUID) of the file. Specify either fileUrl or fileId but not both
--scope [scope] The scope of the sharing link
--confirm Don't prompt for confirmation

Examples

Removes all sharing links from a file without prompting for confirmation

m365 spo file sharinglink clear --webUrl https://contoso.sharepoint.com/sites/demo --fileId daebb04b-a773-4baa-b1d1-3625418e3234 --confirm

Removes all sharing links from a file by url with prompting for confirmation

m365 spo file sharinglink clear --webUrl https://contoso.sharepoint.com/sites/demo --fileUrl /sites/demo/shared%20documents/document.docx

Additional Info

In this case, it will be useful to reuse the command m365 spo file sharinglink list to get a list of all the sharing links and remove these.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions