Skip to main content

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 or folderId but not both.

--folderId [folderId]

The unique ID (GUID) of the folder. Specify either folderUrl or folderId 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 is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--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

{
"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
}
}
CTRL + M