spo file sharinglink get
Gets details about a specific sharing link of a file
Usage
m365 spo file sharinglink get [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.-i, --id <id>
The ID of the sharing link.
-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
Gets a specific sharing link of a file by id.
m365 spo file sharinglink get --webUrl 'https://contoso.sharepoint.com/sites/demo' --fileId daebb04b-a773-4baa-b1d1-3625418e3234 --id 1ba739c5-e693-4c16-9dfa-042e4ec62972
Gets a specific sharing link of a file by a specified site-relative URL.
m365 spo file sharinglink get --webUrl 'https://contoso.sharepoint.com/sites/demo' --fileUrl 'Shared Documents/document.docx' --id 1ba739c5-e693-4c16-9dfa-042e4ec62972
Gets a specific sharing link of a file by a specified server-relative URL.
m365 spo file sharinglink get --webUrl 'https://contoso.sharepoint.com/sites/demo' --fileUrl '/sites/demo/Shared Documents/document.docx' --id 1ba739c5-e693-4c16-9dfa-042e4ec62972
Response
- JSON
- Text
- CSV
- Markdown
{
"id": "1ba739c5-e693-4c16-9dfa-042e4ec62972",
"roles": [
"write"
],
"hasPassword": false,
"grantedToIdentitiesV2": [
{
"user": {
"displayName": "John Doe",
"email": "john@contoso.onmicrosoft.com",
"id": "04355ecd-2124-4097-bc2b-c2295a71d7a3"
},
"siteUser": {
"displayName": "John Doe",
"email": "john@contoso.onmicrosoft.com",
"id": "11",
"loginName": "i:0#.f|membership|john@contoso.onmicrosoft.com"
}
}
],
"grantedToIdentities": [
{
"user": {
"displayName": "John Doe",
"email": "john@contoso.onmicrosoft.com",
"id": "04355ecd-2124-4097-bc2b-c2295a71d7a3"
}
}
],
"link": {
"scope": "organization",
"type": "edit",
"webUrl": "https://contoso.sharepoint.com/:w:/s/demo/EecoJa3lri9Hu9NWp-W0aBQB8ZqmGqA5tdIiaab4o-6BZw",
"preventsDownload": false
}
}
grantedToIdentities : [{"user":{"displayName":"John Doe","email":"john@contoso.onmicrosoft.com","id":"04355ecd-2124-4097-bc2b-c2295a71d7a3"}}]
grantedToIdentitiesV2: [{"user":{"displayName":"John Doe","email":"john@contoso.onmicrosoft.com","id":"04355ecd-2124-4097-bc2b-c2295a71d7a3"},"siteUser":{"displayName":"John Doe","email":"john@contoso.onmicrosoft.com","id":"11","loginName":"i:0#.f|membership|john@contoso.onmicrosoft.com"}}]
hasPassword : false
id : 1ba739c5-e693-4c16-9dfa-042e4ec62972
link : {"scope":"organization","type":"edit","webUrl":"https://contoso.sharepoint.com/:w:/s/demo/EecoJa3lri9Hu9NWp-W0aBQB8ZqmGqA5tdIiaab4o-6BZw","preventsDownload":false}
roles : ["write"]
id,roles,hasPassword,grantedToIdentitiesV2,grantedToIdentities,link
1ba739c5-e693-4c16-9dfa-042e4ec62972,"[""write""]",,"[{""user"":{""displayName"":""John Doe"",""email"":""john@contoso.onmicrosoft.com"",""id"":""04355ecd-2124-4097-bc2b-c2295a71d7a3""},""siteUser"":{""displayName"":""John Doe"",""email"":""john@contoso.onmicrosoft.com"",""id"":""11"",""loginName"":""i:0#.f|membership|john@contoso.onmicrosoft.com""}}]","[{""user"":{""displayName"":""John Doe"",""email"":""john@contoso.onmicrosoft.com"",""id"":""04355ecd-2124-4097-bc2b-c2295a71d7a3""}}]","{""scope"":""organization"",""type"":""edit"",""webUrl"":""https://contoso.sharepoint.com/:w:/s/demo/EecoJa3lri9Hu9NWp-W0aBQB8ZqmGqA5tdIiaab4o-6BZw"",""preventsDownload"":false}"
# spo file sharinglink get --webUrl "https://contoso.sharepoint.com/sites/demo" --fileUrl "/sites/demo/Shared Documents/logo.jpg" --id "9239171b-d85c-4206-a852-45e8d61f9052"
Date: 10/3/2023
## 9239171b-d85c-4206-a852-45e8d61f9052
Property | Value
---------|-------
id | 9239171b-d85c-4206-a852-45e8d61f9052
shareId | u!aHR0cHM6Ly9uYWNoYW4zNjUuc2hhcmVwb2ludC5jb20vOmk6L3MvU1BEZW1vL0VZQ09MTEoydWs1QWlQcHoyX1gwRjhBQkdGSXZXbG1aaDdjZ1BCNXc2WGQxQ2c
expirationDateTime | 2023-12-12T16:20:00Z
hasPassword | false