spo file sharinglink remove
Removes a specific sharing link of a file
Usage
m365 spo file sharinglink remove [options]
Options
-u, --webUrl <webUrl>The URL of the site where the file is located.
--fileUrl [fileUrl]The server- or site-relative decoded URL of the file. Specify either
fileUrlorfileIdbut not both.--fileId [fileId]The UniqueId (GUID) of the file. Specify either
fileUrlorfileIdbut not both.-i, --id <id>The ID of the sharing link.
-f, --forceDon't prompt for confirmation.
-h, --help [help]Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options,examples,remarks,permissions,response,full. Default isoptions.--query [query]JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]Output type.
json,text,csv,md,none. Defaultjson.--verboseRuns command with verbose logging.
--debugRuns command with debug logging.
Examples
Removes a specific sharing link from a file by id without prompting for confirmation.
m365 spo file sharinglink remove --webUrl https://contoso.sharepoint.com/sites/demo --fileId daebb04b-a773-4baa-b1d1-3625418e3234 --id c391b57d-5783-4c53-9236-cefb5c6ef323 --force
Removes a specific sharing link from a file by a specified site-relative URL.
m365 spo file sharinglink remove --webUrl https://contoso.sharepoint.com/sites/demo --fileUrl 'Shared Documents/document.docx' --id c391b57d-5783-4c53-9236-cefb5c6ef323
Removes a specific sharing link from a file by a specified server-relative URL.
m365 spo file sharinglink remove --webUrl https://contoso.sharepoint.com/sites/demo --fileUrl '/sites/demo/Shared Documents/document.docx' --id c391b57d-5783-4c53-9236-cefb5c6ef323
Response
The command won't return a response on success.