spo file sharinglink list
Lists all the sharing links of a specific file
Usage
m365 spo file sharinglink list [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
fileUrl
orfileId
but not both.--fileId [fileId]
The UniqueId (GUID) of the file. Specify either
fileUrl
orfileId
but not both.-s, --scope [scope]
Filter the results to only sharing links of a given scope:
anonymous
,users
ororganization
. By default all sharing links are listed.
-h, --help [help]
Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options
,examples
,remarks
,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
.--verbose
Runs command with verbose logging.
--debug
Runs command with debug logging.
Examples
List sharing links of a file by id.
m365 spo file sharinglink list --webUrl https://contoso.sharepoint.com/sites/demo --fileId daebb04b-a773-4baa-b1d1-3625418e3234
List sharing links of a file by url.
m365 spo file sharinglink list --webUrl https://contoso.sharepoint.com/sites/demo --fileUrl "/sites/demo/shared documents/document.docx"
List anonymous sharing links of a file by url.
m365 spo file sharinglink list --webUrl https://contoso.sharepoint.com/sites/demo --fileUrl "/sites/demo/shared documents/document.docx" --scope anonymous
Response
- JSON
- Text
- CSV
- Markdown
[
{
"id": "2a021f54-90a2-4016-b3b3-5f34d2e7d932",
"roles": [
"read"
],
"hasPassword": false,
"grantedToIdentitiesV2": [
{
"user": {
"displayName": "John Doe",
"email": "john@contoso.onmicrosoft.com",
"id": "fe36f75e-c103-410b-a18a-2bf6df06ac3a"
},
"siteUser": {
"displayName": "John Doe",
"email": "john@contoso.onmicrosoft.com",
"id": "9",
"loginName": "i:0#.f|membership|john@contoso.onmicrosoft.com"
}
}
],
"grantedToIdentities": [
{
"user": {
"displayName": "John Doe",
"email": "john@contoso.onmicrosoft.com",
"id": "fe36f75e-c103-410b-a18a-2bf6df06ac3a"
}
}
],
"link": {
"scope": "organization",
"type": "view",
"webUrl": "https://contoso.sharepoint.com/:w:/s/demo/EY50lub3559MtRKfj2hrZqoBWnHOpGIcgi4gzw9XiWYJ-A",
"preventsDownload": false
}
}
]
id scope roles link
------------------------------------ ------------ ----- ----------------------------------------------------------------------------------------
2a021f54-90a2-4016-b3b3-5f34d2e7d932 organization read https://contoso.sharepoint.com/:w:/s/demo/EY50lub3559MtRKfj2hrZqoBWnHOpGIcgi4gzw9XiWYJ-A
id,scope,roles,link
2a021f54-90a2-4016-b3b3-5f34d2e7d932,organization,read,https://contoso.sharepoint.com/:w:/s/demo/EY50lub3559MtRKfj2hrZqoBWnHOpGIcgi4gzw9XiWYJ-A
# spo file sharinglink list --webUrl "https://contoso.sharepoint.com/sites/demo" --fileUrl "/sites/demo/Shared Documents/logo.jpg"
Date: 10/3/2023
## 44934455-df4f-48a4-90c9-cd8aec82fa7b
Property | Value
---------|-------
id | 44934455-df4f-48a4-90c9-cd8aec82fa7b
shareId | u!aHR0cHM6Ly9uYWNoYW4zNjUuc2hhcmVwb2ludC5jb20vOmk6L3MvU1BEZW1vL0VZQ09MTEoydWs1QWlQcHoyX1gwRjhBQmdwNGFNOWUwaVJEUi0xazVGTm93bnc
hasPassword | false