We have some files missing on a sub-site from which I have tried to use a script to restore.

I connect to the context using connect-pnponline giving the specific team address t5\ts1. I confirm context using get-pnpweb which is correct.

When I get the recycle bin count using (get-pnprecyclebin).count it gives me the parent sites recycle bin count and not the current context. Subsequently, if i use get-pnprecyclebin | restore-pnprecyclebin it will restore items from the Parent, onwards.

How would I specify that I require only items from the current context to be restored. i.e the Sub Site only.

Thank you

1 Answer 1


When running this command, it is prudent to try to execute it using a user that only has access to the data you require restored.

Using a Site Collection Administrator account, as I was, was rendering all my Current Parent site context content.

There are clearly dangerous consequences to this command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.