Skip to content

Instantly share code, notes, and snippets.

@pblop
Last active December 10, 2024 11:31
Show Gist options
  • Save pblop/b3b3545a12692e6768a3b91e6b049b95 to your computer and use it in GitHub Desktop.
Save pblop/b3b3545a12692e6768a3b91e6b049b95 to your computer and use it in GitHub Desktop.
Little snippet to generate a "siteid" for rclone when adding a sharepoint drive as a remote
const pageContext = _spPageContextInfo
const portalName = new URL(pageContext.webAbsoluteUrl).host
const siteId = pageContext.siteId.replace('{', '').replace('}', '')
const webId = pageContext.webId.replace('{', '').replace('}', '')
const resultId = `${portalName},${siteId},${webId}`
window.prompt(`Copy this id and use it in rclone`, resultId)
/* NOTE:
* You must paste this in the console when in the main page of a sharepoint site.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment