Patrick Lamber
Patrick Lamber Microsoft Office Development MVP

How do I delete all my Microsoft 365 Groups and SharePoint Online sites in my development environment?

The CLI for Microsoft 365 is a cross-platform command-line interface used to manage or automate Microsoft 365 resources. It is a PnP and community-driven initiative that is growing rapidly over time.

I am actively working on our Microsoft 365 governance tool EasyLife365. We are creating thousands of Microsoft 365 Groups and SharePoint Online sites during development and testing. On some occasions, we want to clean up our environment and start fresh.

This sample script shows you how you can enumerate all Microsoft 365 Groups in your test tenant and delete these Groups. Afterward, it also processes all SPO sites and deletes them permanently.

Please execute this script carefully.

comments powered by Disqus