Replies: 1 comment
-
I got it, it was delegate permissions |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We have some old scripts that reference a users Onedrive to copy a file from an on-prem folder to Onedrive
We have noticed this is constantly failing now - I'm guessing due to the changes to PNP application registered in tenant.
We have registered a new application and now login via;
Connect-PnPOnline -Url $SiteURL -Credentials $credObject -ClientId [number]
The PNP connection works correctly and I can see I'm connected to the users Onedrive via Get-PNPconnection/Get-PNPContext
$sourcefilepath is the network path of the file to copy "\domain\site\shared\filename.csv"
$folderpath is in the format "documents/foldername/foldername2"
I have tested this after giving the new PNP registration Graph API Sites.Manage.All and Sharepoint API Sites.Manage.All
The $credentials we use have full ownership on the users onedrive as a service account or has access to the file
So the full script we use is;
Beta Was this translation helpful? Give feedback.
All reactions