Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Delete SharePoint Online sites that have retention policies" sample #696

Merged

Conversation

jackpoz
Copy link
Contributor

@jackpoz jackpoz commented May 11, 2024

This sample script deletes specified SharePoint Online sites that have a retention policy applied by excluding them from the retention policy, deleting the site and then cleaning up the retention policy exclusions.

It uses PnP PowerShell to delete the sites and https://learn.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2 to exclude them from the policy.

Users must modify the sample with the urls of the sites to exclude. Running the script without any change will not delete any site by accident.

Excluding the sites from the retention policy takes some time, from seconds to minutes, which is mentioned in the comments of the script. Ideally one would run the section to exclude the sites, wait, then run the section to delete the sites.

I didn't update preview.png or template.sample.json .

@pkbullock
Copy link
Collaborator

Thank you @jackpoz for this awesome sample, sorry for the delay in processing but this will be live shortly 🎉

@pkbullock pkbullock merged commit be4b7a5 into pnp:main May 19, 2024
@jackpoz
Copy link
Contributor Author

jackpoz commented May 19, 2024

Thanks for accepting it 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants