Rename-PnpFile gives access denied #3540
Unanswered
AdrielFierro
asked this question in
Q&A
Replies: 0 comments
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.
-
Hi!
I'm using mac with visual studio and have sharepoint administrator rights.
I've used copy,add, and move commands without problems but when I use the rename command always gives me access denied.
I've used these commands:
`connect-pnponline -url "https://contoso.sharepoint.com/sites/Clients" -interactive -validateconnection
$file = Get-PnPFile -Url "/sites/Clients/folder/subfolder/IT_testi_password.txt"
Rename-PnPFile -SiteRelativeUrl $file -TargetFileName "workingcommand.txt" -Force -Verbose -Connection(Connect-PnPOnline -Url "https://contoso.sharepoint.com/sites/Clients" -Interactive -ValidateConnection)
`
`
connect-pnponline -url "https://contoso.sharepoint.com/sites/Clients" -interactive -validateconnection
Rename-PnPFile -SiteRelativeUrl "/sites/Clients/folder/subfolder/IT_testi_password.txt" -TargetFileName "workingcommand.txt" -Force -Verbose -Connection(Connect-PnPOnline -Url "https://contoso.sharepoint.com/sites/Clients" -Interactive -ValidateConnection)
this is the response of the code
Rename-PnPFile: /Users/adrif/Desktop/SPO project/Scripts/Untitled-1.ps1:4:1Line |
4 | Rename-PnPFile -SiteRelativeUrl "/sites/Clients/folder/subfolder/IT_testi_password.txt" -T …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Access denied.
`
this code I'm uploading is to show that I can put everything I want in siterelativeURL and will always says Access denied
PS /Users/adrif> . '/Users/adrif/Desktop/SPO project/Scripts/Untitled-1.ps1' Rename-PnPFile: /Users/adrif/Desktop/SPO project/Scripts/Untitled-1.ps1:4:1 Line | 4 | Rename-PnPFile -SiteRelativeUrl "asrfeqrew" -TargetFileName "workingc … | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Access denied.
does anyone knows what I'm leaving out?
Beta Was this translation helpful? Give feedback.
All reactions