Remove sharepoint online file versions with PnP

Copper Contributor

I'm getting "Access denied" when using Remove-PnPFileVersion, even though I've got no problem deleting the entire file with Remove-PnPFileListItem

2 Replies

@OmarSeri What permissions you have on the document library and SharePoint site?

 

Try using Site Collection Administrator (SCA) account.


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

@ganeshsanap 

What permissions you have on the document library and SharePoint site?

Because we are talking here of a SharePoint created automatically with related Team, Document library inherits from parent (SharePoint site I think).

When I "Verify permissions" in SharePoint Site, I have Total Control from Owners group, and Modification from Members group.

But what it looks weird is that I have no problem using Remove-PnPListItem: the command deleted all files without notifying any permission issue.