spo folder sharinglink set
Updates a sharing link of a folder
Usage
m365 spo folder sharinglink set [options]
Options
-u, --webUrl <webUrl>
The URL of the site where the folder is located.
--folderUrl [folderUrl]
The server- or site-relative decoded URL of the folder. Specify either
folderUrl
orfolderId
but not both.--folderId [folderId]
The unique ID (GUID) of the folder. Specify either
folderUrl
orfolderId
but not both.--id <id>
The sharing link ID.
--expirationDateTime <expirationDateTime>
The date and time to set the expiration. This should be defined as a valid ISO 8601 string. This option only works for anonymous links.
-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
Updates the expiration datetime of an anonymous sharing link for a folder specific by folder ID.
m365 spo folder sharinglink set --webUrl https://contoso.sharepoint.com/sites/demo --folderId daebb04b-a773-4baa-b1d1-3625418e3234 --id 7c9f97c9-1bda-433c-9364-bb83e81771ee --expirationDateTime '2022-11-30T00:00:00Z'
Updates the expiration datetime of an anonymous sharing link for a folder specific by folder URL.
m365 spo folder sharinglink set --webUrl https://contoso.sharepoint.com/sites/demo --folderUrl /sites/demo/shared%20documents/Folder --id 7c9f97c9-1bda-433c-9364-bb83e81771ee --expirationDateTime '2022-11-30T00:00:00Z'
Response
- JSON
- Text
- CSV
- Markdown
{
"id": "bd1481e9-958b-4c1a-a33c-fb021f4ed444",
"roles": [
"write"
],
"shareId": "u!aHR0cHM6Ly83NTY2YXZhLnNoYXJlcG9pbnQuY29tLzpmOi9nL0VwLVpGUHF2YkVsQnNnWXJhRjJBNG1jQmZWM1A3cU00eGZVVXJRZHdnSXllNGc",
"expirationDateTime": "2024-05-05T16:57:00Z",
"hasPassword": false,
"grantedToIdentitiesV2": [],
"grantedToIdentities": [],
"link": {
"scope": "anonymous",
"type": "edit",
"webUrl": "https://contoso.sharepoint.com/:f:/g/Ep-ZFPqvbElBsgYraF2A4mcBfV3P7qM4xfUUrQdwgIye4g",
"preventsDownload": false
}
}
expirationDateTime : 2024-05-05T16:57:00Z
grantedToIdentities : []
grantedToIdentitiesV2: []
hasPassword : false
id : bd1481e9-958b-4c1a-a33c-fb021f4ed444
link : {"scope":"anonymous","type":"edit","webUrl":"https://contoso.sharepoint.com/:f:/g/Ep-ZFPqvbElBsgYraF2A4mcBfV3P7qM4xfUUrQdwgIye4g","preventsDownload":false}
roles : ["write"]
shareId : u!aHR0cHM6Ly83NTY2YXZhLnNoYXJlcG9pbnQuY29tLzpmOi9nL0VwLVpGUHF2YkVsQnNnWXJhRjJBNG1jQmZWM1A3cU00eGZVVXJRZHdnSXllNGc
id,shareId,expirationDateTime,hasPassword
bd1481e9-958b-4c1a-a33c-fb021f4ed444,u!aHR0cHM6Ly83NTY2YXZhLnNoYXJlcG9pbnQuY29tLzpmOi9nL0VwLVpGUHF2YkVsQnNnWXJhRjJBNG1jQmZWM1A3cU00eGZVVXJRZHdnSXllNGc,2024-05-05T16:57:00Z,
# spo folder sharinglink set --webUrl "https://contoso.sharepoint.com" --folderUrl "/shared documents/f1" --id "bd1481e9-958b-4c1a-a33c-fb021f4ed444" --expirationDateTime "2024-05-05T16:57:00.000Z"
Date: 03/05/2024
## bd1481e9-958b-4c1a-a33c-fb021f4ed444
Property | Value
---------|-------
id | bd1481e9-958b-4c1a-a33c-fb021f4ed444
shareId | u!aHR0cHM6Ly83NTY2YXZhLnNoYXJlcG9pbnQuY29tLzpmOi9nL0VwLVpGUHF2YkVsQnNnWXJhRjJBNG1jQmZWM1A3cU00eGZVVXJRZHdnSXllNGc
expirationDateTime | 2024-05-05T16:57:00Z
hasPassword | false