Skip to content

Readonly onedrive client in NodeJS, sync local folder with remote contents

Notifications You must be signed in to change notification settings

polito/onedrive-graph-sync

Repository files navigation

onedrive-graph-sync

This simple program syncs a local folder with a remote OneDrive location. Create a .env file following the example for configuration.

App grants setup

The following will prompt user login: login with a user with admin permissions on the sharepoint/onedrive drive you want to sync.

Install-Module -Name Az -Repository PSGallery -Force
Install-Module PnP.PowerShell -Scope CurrentUser

$siteUrl = "https://politoit.sharepoint.com/teams/SOME_TEAM"
$clientId = "deadbeef-abba-acca-adda-deadbeef1234"
$tenant = "politoit.onmicrosoft.com"
 
Connect-PnPOnline -Url $siteUrl -Interactive
$writeperm = Grant-PnPAzureADAppSitePermission -Permissions "Read" -Site $siteUrl -AppId $clientId -DisplayName "SOME_MEANINGFUL_NAME"
$PermissionId = Get-PnPAzureADAppSitePermission -AppIdentity $clientId
Set-PnPAzureADAppSitePermission -Site $siteurl -PermissionId $(($PermissionId).Id) -Permissions "FullControl"

About

Readonly onedrive client in NodeJS, sync local folder with remote contents

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published